[Zope3-Users] Re: Is this a bug of HTTP response's head handling?
(publisherhttpserver.py)
Philipp von Weitershausen
philipp at weitershausen.de
Fri Sep 22 03:37:47 EDT 2006
Looks better now. I suggest filing a collector issue and attaching the
patch. Somebody knowledgeable can then look at it.
Simon Hang wrote:
> Philipp,
> Sorry for being lazy, and thanks for the tips. Here is my update version.
> --- httptask.py.orig Fri Jan 06 02:15:48 2006
> +++ httptask.py Fri Sep 22 09:13:48 2006
> @@ -126,6 +126,11 @@
> else:
> close_it = 1
> elif version == '1.1':
> + #modified by Simon
> + if 'connection: close' in (header.lower() for header in
> + self.accumulated_headers):
> + #Close if 'connection: close' found in http response's
> header
> + close_it = 1
> if connection == 'close':
> close_it = 1
> elif 'Transfer-Encoding' in response_headers:
> @@ -134,8 +139,13 @@
> elif self.status == '304':
> # Replying with headers only.
> pass
> + #modified by simon
> elif not ('Content-Length' in response_headers):
> - close_it = 1
> + if 'content-length' not in (header[:14].lower() for
> header in
> + self.accumulated_headers):
> + #Close if 'content-length' not found in
> + #http response's header and self.response_headers
> + close_it = 1
> else:
> # Close if unrecognized HTTP version.
> close_it = 1
>
More information about the Zope3-users
mailing list