Re: mod_python re-writing custom HTTP response codes to 500

Graham Dumpleton <[email protected]> Sat, 8 Aug 2009 11:38:05 +1000
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
This is better asked on a Django list as unlikely that it would have
anything to do with mod_python but how you are raising the errors in
Django and whether Django allows you to override those errors. I would
suggest that when you post to Django list, that you provide them code
snippet to show how you are setting up that response status.

Graham

2009/8/8 Graham King <[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
> _______________________________________________
> Mod_python mailing list
> [email protected]
> http://mailman.modpython.org/mailman/listinfo/mod_python
>