[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/ Fixed functional.http to only pass the request body (no headers) to

Stefan H. Holek stefan at epy.co.at
Sat Sep 2 11:43:55 EDT 2006


Log message for revision 69933:
  Fixed functional.http to only pass the request body (no headers) to
  publish_module. Thanks to Andreas Zeidler.
  

Changed:
  U   Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py

-=-
Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt	2006-09-02 14:49:12 UTC (rev 69932)
+++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt	2006-09-02 15:43:55 UTC (rev 69933)
@@ -9,6 +9,8 @@
 - Made sure logging is configured. Read $INSTANCE_HOME/log.ini if it exists.
 - Made base.TestCase a new-style class.
 - Added placeless.py for Z3-style setup. Thanks to Whit Morriss.
+- Fixed functional.http to only pass the request body (no headers) to
+  publish_module. Thanks to Andreas Zeidler.
 
 0.9.8 (Zope 2.8 edition)
 - Renamed 'doctest' package to 'zopedoctest' because of name-shadowing

Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py	2006-09-02 14:49:12 UTC (rev 69932)
+++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py	2006-09-02 15:43:55 UTC (rev 69933)
@@ -132,7 +132,7 @@
     # Discard leading white space to make call layout simpler
     request_string = request_string.lstrip()
 
-    # split off and parse the command line
+    # Split off and parse the command line
     l = request_string.find('\n')
     command_line = request_string[:l].rstrip()
     request_string = request_string[l+1:]
@@ -162,6 +162,10 @@
 
     headers = [split_header(header)
                for header in rfc822.Message(instream).headers]
+
+    # Store request body without headers
+    instream = StringIO(instream.read())
+
     for name, value in headers:
         name = ('_'.join(name.upper().split('-')))
         if name not in ('CONTENT_TYPE', 'CONTENT_LENGTH'):



More information about the Zope-Checkins mailing list