mod_python re-writing custom HTTP response codes to 500
Graham King <[email protected]> Fri, 7 Aug 2009 15:45:38 -0700
| Newsgroups | gmane.comp.python.mod_python |
|---|---|
| Message-ID | <[email protected]> |
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