[mod_python] mod_python re-writing custom HTTP response codes to 500

Graham King graham at gkgk.org
Fri Aug 7 18:45:38 EDT 2009


 Hi,

When sending an unofficial HTTP response code (I tried 278, 209 and
600) from a Django view, mod_python seems to be re-writing it to 500.
Django with mod_wsgi on the same server doesn't change the response
code.

In mod_python.c (for mod_python 3.3.1) line 1730 there is this comment:
  'If the req->status or return code is a weird number that the server
doesn't know, it will default to 500 Internal Server Error.'

Is this expected behavior? Is there any way around it?
I am trying to get a custom HTTP response code to Javascript (XMLHttpRequest).

Thanks in advance,
Graham King


More information about the Mod_python mailing list