Log message for revision 77282:
  Collector #2153: Supporting unquoted cookies with spaces.
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py
  U   Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.9/doc/CHANGES.txt   2007-07-01 13:32:18 UTC (rev 77281)
+++ Zope/branches/2.9/doc/CHANGES.txt   2007-07-01 13:41:59 UTC (rev 77282)
@@ -8,6 +8,8 @@
 
    Bugs fixed
 
+      - Collector #2153: Supporting unquoted cookies with spaces.
+
       - Collector #2295: Comments in PythonScripts could lead to syntax
         errors
 

Modified: Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py
===================================================================
--- Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py      2007-07-01 
13:32:18 UTC (rev 77281)
+++ Zope/branches/2.9/lib/python/ZPublisher/HTTPRequest.py      2007-07-01 
13:41:59 UTC (rev 77282)
@@ -1457,7 +1457,7 @@
                  qparmre=re.compile(
                     '([\x00- ]*([^\x00- ;,="]+)="([^"]*)"([\x00- 
]*[;,])?[\x00- ]*)'),
                  parmre=re.compile(
-                    '([\x00- ]*([^\x00- ;,="]+)=([^\x00- ;,"]*)([\x00- 
]*[;,])?[\x00- ]*)'),
+                    '([\x00- ]*([^\x00- ;,="]+)=([^;,"]*)([\x00- 
]*[;,])?[\x00- ]*)'),
                  paramlessre=re.compile(
                     '([\x00- ]*([^\x00- ;,="]+)[\x00- ]*[;,][\x00- ]*)'),
 

Modified: Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py
===================================================================
--- Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py    
2007-07-01 13:32:18 UTC (rev 77281)
+++ Zope/branches/2.9/lib/python/ZPublisher/tests/testHTTPRequest.py    
2007-07-01 13:41:59 UTC (rev 77282)
@@ -649,6 +649,20 @@
         self.assertEquals(req.cookies['hmm'], '')
         self.assertEquals(req.cookies['baz'], 'gee')
 
+       # Unquoted multi-space cookies
+        env['HTTP_COOKIE'] = 'single=cookie data; ' \
+                            'quoted="cookie data with unquoted spaces"; ' \
+                            'multi=cookie data with unquoted spaces; ' \
+                            'multi2=cookie data with unquoted spaces'
+        req = self._getHTTPRequest(env)
+        self.assertEquals(req.cookies['single'], 'cookie data')
+        self.assertEquals(req.cookies['quoted'], 
+                                     'cookie data with unquoted spaces')
+        self.assertEquals(req.cookies['multi'], 
+                                     'cookie data with unquoted spaces')
+        self.assertEquals(req.cookies['multi2'], 
+                                     'cookie data with unquoted spaces')
+
 TEST_ENVIRON = {
     'CONTENT_TYPE': 'multipart/form-data; boundary=12345',
     'REQUEST_METHOD': 'POST',

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

Reply via email to