[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-cvs
Subject:    [Zope-Checkins]
From:       Andreas Jung <andreas () andreas-jung ! com>
Date:       2005-09-24 10:34:49
Message-ID: 20050924103449.4858720345A () mail ! zope ! org
[Download RAW message or body]

Log message for revision 38584:
  
  Collector #1864, #1906: fixed header normalization in appendHeader()
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py
  U   Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===================================================================
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2005-09-24 10:24:16 UTC (rev 38583)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2005-09-24 10:34:48 UTC (rev 38584)
@@ -31,6 +31,8 @@
 
     Bugs Fixed
 
+      - Collector #1864, #1906: fixed header normalization in appendHeader()
+
       - Collector #1899: fixed migration issue when using export/import for
         ZCatalog instances
 

Modified: Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py	2005-09-24 \
                10:24:16 UTC (rev 38583)
+++ Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/HTTPResponse.py	2005-09-24 \
10:34:48 UTC (rev 38584) @@ -544,7 +544,7 @@
         Sets an HTTP return header "name" with value "value",
         appending it following a comma if there was a previous value
         set for the header. '''
-        name = str(name)
+        name = str(name).lower()
         value = str(value)
 
         headers = self.headers

Modified: Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py
 ===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py	2005-09-24 \
                10:24:16 UTC (rev 38583)
+++ Zope/branches/Zope-2_8-branch/lib/python/ZPublisher/tests/testHTTPResponse.py	2005-09-24 \
10:34:48 UTC (rev 38584) @@ -65,6 +65,16 @@
         self.assertEqual(cookie.get('value'), 'bar:baz')
         self.assertEqual(cookie.get('path'), '/')
 
+    def test_appendHeader(self):
+        response = self._makeOne()
+        response.setHeader('foo', 'bar')
+        response.appendHeader('foo', 'foo')
+        self.assertEqual(response.headers.get('foo'), 'bar,\n\tfoo')
+        response.setHeader('xxx', 'bar')
+        response.appendHeader('XXX', 'foo')
+        self.assertEqual(response.headers.get('xxx'), 'bar,\n\tfoo')
+
+
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(HTTPResponseTests, 'test'))

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic