Re: [Zope-dev] [Checkins] SVN: Zope/trunk/ `setHeader('Set-Cookie', ...)` special-casing can die
Hi Martijn, There are test failures on Zope trunk which look to be connected to your changes. https://mail.zope.org/pipermail/zope-tests/2011-October/051224.html Please investigate, Stefan On 13.10.2011, at 15:18, Martijn Pieters wrote:
Log message for revision 123087: `setHeader('Set-Cookie', ...)` special-casing can die
Use the cookie APIs or addHeader instead.
Changed: U Zope/trunk/doc/CHANGES.rst U Zope/trunk/src/ZPublisher/HTTPResponse.py
-=- Modified: Zope/trunk/doc/CHANGES.rst =================================================================== --- Zope/trunk/doc/CHANGES.rst 2011-10-13 09:46:28 UTC (rev 123086) +++ Zope/trunk/doc/CHANGES.rst 2011-10-13 13:18:32 UTC (rev 123087) @@ -50,6 +50,11 @@ Restructuring +++++++++++++
+- Removed the special handling of `Set-Cookie` headers in + `HTTPResponse.setHeader`. Use the `setCookie`/`appendCookie`/`expireCookie` + methods instead, or if low-level control is needed, use `addHeader` instead + to get the exact same effect. + - Removed the `App.version_txt.getZopeVersion` API, you can use ``pkg_resources.get_distribution('Zope2').version`` instead.
Modified: Zope/trunk/src/ZPublisher/HTTPResponse.py =================================================================== --- Zope/trunk/src/ZPublisher/HTTPResponse.py 2011-10-13 09:46:28 UTC (rev 123086) +++ Zope/trunk/src/ZPublisher/HTTPResponse.py 2011-10-13 13:18:32 UTC (rev 123087) @@ -330,13 +330,8 @@ if not scrubbed: name, value = _scrubHeader(name, value) key = name.lower() - # The following is crazy, given that we have APIs for cookies. - # Special behavior will go away in Zope 2.13 - if key == 'set-cookie': - self.accumulated_headers.append((name, value)) - else: - name = literal and name or key - self.headers[name] = value + name = literal and name or key + self.headers[name] = value
def appendHeader(self, name, value, delimiter=", "): """ Append a value to an HTTP return header.
_______________________________________________ checkins mailing list checkins@zope.org https://mail.zope.org/mailman/listinfo/checkins
-- Stefan H. Holek stefan@epy.co.at
On Mon, Oct 17, 2011 at 11:57, Stefan H. Holek <stefan@epy.co.at> wrote:
There are test failures on Zope trunk which look to be connected to your changes. https://mail.zope.org/pipermail/zope-tests/2011-October/051224.html
Please investigate,
Ugh. Those tests can go, and someone already dealt with them before I got to them. Mea Culpa! -- Martijn Pieters
participants (2)
-
Martijn Pieters -
Stefan H. Holek