[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/tests/dochttp.py Exclude content-length from generated input.

Jim Fulton jim at zope.com
Tue Feb 1 14:50:12 EST 2005


Log message for revision 29015:
  Exclude content-length from generated input.
  

Changed:
  U   Zope3/trunk/src/zope/app/tests/dochttp.py

-=-
Modified: Zope3/trunk/src/zope/app/tests/dochttp.py
===================================================================
--- Zope3/trunk/src/zope/app/tests/dochttp.py	2005-02-01 18:50:18 UTC (rev 29014)
+++ Zope3/trunk/src/zope/app/tests/dochttp.py	2005-02-01 19:50:12 UTC (rev 29015)
@@ -52,7 +52,7 @@
 
     '-I', 'Accept-Charset', '-I', 'Accept-Encoding', '-I', 'Accept-Language',
     '-I', 'Accept', '-I', 'Connection', '-I', 'Host', '-I', 'Keep-Alive',
-    '-I', 'User-Agent',
+    '-I', 'User-Agent', '-I', 'Content-Length',
 
     '-O', 'Date', '-O', 'Server', '-O', 'X-Content-Type-Warning',
     '-O', 'X-Powered-By',
@@ -161,14 +161,16 @@
                  v.rstrip()
                  )
                 for (name, v) in headers
-                if name.lower() not in skip_headers
             ]
-            self.headers = headers
             content_length = int(dict(headers).get('Content-Length', '0'))
             if content_length:
                 self.body = file.read(content_length).split('\n')
             else:
                 self.body = []
+            headers = [(name, v) for (name, v) in headers
+                       if name.lower() not in skip_headers
+                       ]
+            self.headers = headers
 
     def __nonzero__(self):
         return bool(self.start)



More information about the Zope3-Checkins mailing list