Flup Scrubs HTTP Response Codes?

5 views
Skip to first unread message

Chas Emerick

unread,
Aug 14, 2006, 12:42:34 PM8/14/06
to pylons-discuss
I've found that running pylons through flup
(egg:PasteScript#flup_scgi_thread) behind lighttpd results in error
codes not being written to the HTTP response properly. Normal
behaviour is evident when running pylons under the internal HTTP server
(egg:PasteScript#wsgiutils)

For example, accessing a bad URL (which executes my customized
ErrorController's document function to get a pretty error page) through
flup_scgi/lighttpd results in a response like:

HTTP/1.1 200 OK
Connection: close
Status: 404 Not Found
[.... etc .....]

While accessing the same URL through PasteScript#wsgiutils results in a
response like:

HTTP/1.0 404 Not Found
Server: SimpleHTTP/0.6 Python/2.4.2
Date: Mon, 14 Aug 2006 16:40:49 GMT
[.... etc ....]

The status code is clearly wrong under flup, although I'm unsure as to
the origin of the problem. Thoughts?

Thanks,

Chas Emerick
ceme...@snowtide.com

Chas Emerick

unread,
Aug 15, 2006, 3:16:28 AM8/15/06
to pylons-discuss
OK, my bad. This problem was entirely my fault, so I figured I should
at the very least let everyone know. :-)

The issue was in our lighttpd config. This line was catching the 404's
(the remains of a RoR fcgi config):

server.error-handler-404 = "/"

What I still don't understand is why 404's simply didn't redirect to
"/" as specified in this rule -- the error documents were still
flowing, they just had their status codes munged. I'm glad to leave
that question unanswered.

- Chas

Reply all
Reply to author
Forward
0 new messages