[Zope] streamed output and the removal content-length header

Sam Gendler sgendler@impossible.com
Mon, 03 Jan 2000 11:49:22 -0800


Mailing List Recepient wrote:
> 
> i'm confused on the implementation of ZPublisher's HTTPResponse object.
> 
> I am currently using the HTTPReponse's write method to return data from
> the Zope server to the client browser as opposed to returning a string
> at the end of my published method.
> 
> Streamed output using HTTPResponse.write works fine when using Netscape,
> but fails in Internet Explorer.  I've tracked the problem down to the
> fact that Netscape doesn't mind receiving a "content-length" header of
> 0, whereas unforgiving Explorer flat out fails.
> 
> I tried to workaround this by supplying the content-length, but to no
> avail.  My content-length header is removed (this is done in
> HTTPReponse's write method) and the content-length returned is still 0.
> 
> Why is the content-length header removed?  Is there a way to get
> streamed output working under Internet Explorer?
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

Sending a Content-Length header of 0 is definitely a bug.  It is legal
to not send a Content-Length header at all, and both browsers will
happily deal with it.  However, sending a false Content-length is a
definite error.  IE is behaving correctly.  If you want to fix the
problem, find the code that is sending Content-Length: 0 and remove it. 
Both browsers will start working.

--sam