Copterfly / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

When headers are flushed is not WSGI compliant. #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The WSGI specification says:

"""The start_response callable must not actually transmit the response
headers. Instead, it must store them for the server or gateway to transmit
only after the first iteration of the application return value that yields
a non-empty string, or upon the application's first invocation of the
write() callable. In other words, response headers must not be sent until
there is actual body data available, or until the application's returned
iterable is exhausted. (The only possible exception to this rule is if the
response headers explicitly include a Content-Length of zero.)"""

In mod_wsgi it is not complying with this 100% as it will transmit the
headers even if the first string yielded is an empty string.

In general use this is not likely to present any problems. The only time it
may be an issue is where start_response() is called a second time in an
attempt to change the type of response that is sent before any actual
non-empty strings have been yielded.

This would not be a common practice so you would be unlucky to be affected
by this.

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 6 Oct 2007 at 12:34

GoogleCodeExporter commented 9 years ago
Fixed at revision 566 in 1.X branch of subversion repository:

  http://modwsgi.googlecode.com/svn/branches/mod_wsgi-1.X

Original comment by Graham.Dumpleton@gmail.com on 6 Oct 2007 at 3:15

GoogleCodeExporter commented 9 years ago
Whoops. That is revision 569, not 566.

Original comment by Graham.Dumpleton@gmail.com on 6 Oct 2007 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by Graham.Dumpleton@gmail.com on 30 Oct 2007 at 2:07