> You can use pdb with mod_wsgi. Read:

> http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

> You also find in there how to use EvalException from Paste to do in
> browser debugging.

> Graham

Thanks Graham for the tip. Now I found out what's wrong.

When the application is run under Apache, the request header doesn't
contain the 'Content-Type' header while under Paste, it is filled with
an empty string when absent. So under Apache, the code snippet in
configuration.py:

 def header_predicate(context, request):
            if header_val is None:
                return header_name in request.headers
            val = request.headers.get(header_name)
            return header_val.match(val) is not None

will throw an except since val is None.

Changing the line to:

    val = request.headers.get(header_name, '')

fixes the problem.

--
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to