SVN: Zope/trunk/ `setHeader('Set-Cookie', ...)` special-casing can die
Martijn Pieters <[email protected]> Thu, 13 Oct 2011 09:18:33 -0400 (EDT)
| Newsgroups | gmane.comp.web.zope.cvs |
|---|---|
| Message-ID | <20111013131833.E22A8940C9__46887.9542233937$1318511926$gmane$org@cvs.zope.org> |
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.
_______________________________________________
Zope-Checkins maillist - [email protected]
https://mail.zope.org/mailman/listinfo/zope-checkins