[Web-SIG] [modwsgi] Hop-by-hop headers
graham.dumpleton at gmail.com
Fri Aug 10 05:16:24 CEST 2012
Probably better off asking on the Python WEB-SIG. I have cc'd this there.
Someone has probably felt that wsgiref implementation should somehow
be checking for things which aren't notionally allowed but which go
beyond just API usage checks. Checking for hop by hop headers should
possibly have been the job of the wsgiref.validator and not the server
I know of no other server which will outright error when a hop by hop
header is returned by an application, and as you note, there are
sometimes where it is useful to pass back Connection to ensure that
the web server/client drops the current connection and doesn't try and
maintain a keep alive connection.
On 10 August 2012 02:43, Ron Garret <ron at flownet.com> wrote:
> I'm not sure this is the right place to ask this question because it's not really about modwsgi but this is the best place I know to find expertise about WSGI in general.
> Yesterday I fired up some old code using the wsgiref server and got the following error:
> "Hop-by-hop headers not allowed"
> This turned out to be caused by my code including a "Connection: close" header in order to work around an old Safari bug. Trick is, the last time I ran this code under wsgiref it worked, and it hasn't changed. And when I run it under modwsgi it works.
> So my question is: does anyone here know why wsgiref doesn't allow connection headers? And did this change recently? Looking at the wsgiref code it seems to reject Connection headers at least as far back as Python 2.6. My code is old, but it's not that old (less than two years). I'm pretty sure it has run successfully under Python2.6 if not 2.7. It contains WITH statements, so the last time I ran it could not have been under anything earlier than 2.6.
> I'm baffled. Can anyone here shed any light on this?
> You received this message because you are subscribed to the Google Groups "modwsgi" group.
> To post to this group, send email to modwsgi at googlegroups.com.
> To unsubscribe from this group, send email to modwsgi+unsubscribe at googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
More information about the Web-SIG