You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having trouble getting my wsgi application (in this case, Django) to change the status code of the Apache response, and I think it might due to a bug with mod_python. I wrote a simple wsgi handler to confirm: no matter what status string is passed into start_response, the status remains unchanged from '200 OK'.
I got an inspection of the mp_request object being used by the handler, right after start_response is called. Note that status_line is changed but status isn't. Poking around in requestobject.c, I noticed only status_line is updated, I wonder if this has anything to do with it?
I was able to fix this for myself by hacking the WSGI handler to manually adjust req.status property:
# in wsgi.py, line 67...## Run the appresponse=Nonetry:
response=app(env, req.wsgi_start_response)
req.status=int(req.status_line.split(' ', 1)[0]) # added this
[req.write(token) fortokeninresponse]
Version info: Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_python/3.5.0- Python/2.7.7
Take a look at this and see if you can replicate it. Maybe it's just a weird quirk of the somewhat-legacy configuration of the university server I'm on.
The text was updated successfully, but these errors were encountered:
I've been having trouble getting my wsgi application (in this case, Django) to change the status code of the Apache response, and I think it might due to a bug with mod_python. I wrote a simple wsgi handler to confirm: no matter what status string is passed into
start_response
, the status remains unchanged from '200 OK'.I got an inspection of the
mp_request
object being used by the handler, right afterstart_response
is called. Note thatstatus_line
is changed butstatus
isn't. Poking around inrequestobject.c
, I noticed onlystatus_line
is updated, I wonder if this has anything to do with it?I was able to fix this for myself by hacking the WSGI handler to manually adjust
req.status
property:Version info: Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_python/3.5.0- Python/2.7.7
Take a look at this and see if you can replicate it. Maybe it's just a weird quirk of the somewhat-legacy configuration of the university server I'm on.
The text was updated successfully, but these errors were encountered: