[zope2-tracker] [Bug 509926] Re: response.appendHeader leaves carriage return cruft behind

newbery ric at digitalmarbles.com
Thu Jan 21 04:07:55 EST 2010


Hmm... maybe I pulled the trigger on this too fast.  I was originally
trying to figure some odd result with addHeader and put in appendHeader
to see the difference.  Got myself confused, the issue I'm seeing was
with addHeader, not appendHeader.  I blame the late hour.

Anyway, maybe I'm pointing at the wrong culprit here?  Can't seem to do
integration testing with the addHeader.  Maybe it's the testbrowser?
Example follows:

Using Plone with the front page adding a couple of test headers using
addHeader.

First via command line...
% wget -O- -S "http://localhost:8080/Plone"

HTTP/1.0 200 OK
Server: Zope/(2.12.3, python 2.6.4, darwin) ZServer/1.1
Date: Thu, 21 Jan 2010 08:17:40 GMT
Content-Length: 14887
Content-Language: en
Expires: Mon, 24 Jan 2000 08:17:40 GMT
Connection: Keep-Alive
Content-Type: text/html;charset=utf-8
X-Testheader: value1
X-Testheader: value2
...


So wget gets me the expected result.  Now via an integration test in my Plone product...

... (a bunch of test framework setup) ...

>>> from Products.Five.testbrowser import Browser
>>> browser = Browser()
>>> browser.open(self.portal.absolute_url())
>>> print browser.headers

Content-Language: en
Content-Length: 14556
Content-Type: text/html;charset=utf-8
Expires: Mon, 24 Jan 2000 08:19:28 GMTContent-Type: text/html; charset=utf-8
X-UA-Compatible: IE=edge


So the integration test is missing a few headers.  I'm guessing several missing headers (Server, Date, Connection) are because the testbrowser isn't going through the ZServer so I'm ignoring those.  But I'm also missing the X-Testheaders.  But if I instead only set one Testheader, it shows up -- multiple ones and they disappear to the test browser.  A bug in the test browser then?  Should I file another bug report?

-- 
response.appendHeader leaves carriage return cruft behind
https://bugs.launchpad.net/bugs/509926
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.


More information about the zope2-tracker mailing list