Commit d93d4977 authored by Stefan H. Holek's avatar Stefan H. Holek

Fixed functional.http to only pass the request body (no headers) to

publish_module. Thanks to Andreas Zeidler.
parent 81060b9c
...@@ -9,6 +9,8 @@ Zope 2.8 edition ...@@ -9,6 +9,8 @@ Zope 2.8 edition
- Made sure logging is configured. Read $INSTANCE_HOME/log.ini if it exists. - Made sure logging is configured. Read $INSTANCE_HOME/log.ini if it exists.
- Made base.TestCase a new-style class. - Made base.TestCase a new-style class.
- Added placeless.py for Z3-style setup. Thanks to Whit Morriss. - 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) 0.9.8 (Zope 2.8 edition)
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing - Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
......
...@@ -132,7 +132,7 @@ def http(request_string, handle_errors=True): ...@@ -132,7 +132,7 @@ def http(request_string, handle_errors=True):
# Discard leading white space to make call layout simpler # Discard leading white space to make call layout simpler
request_string = request_string.lstrip() request_string = request_string.lstrip()
# split off and parse the command line # Split off and parse the command line
l = request_string.find('\n') l = request_string.find('\n')
command_line = request_string[:l].rstrip() command_line = request_string[:l].rstrip()
request_string = request_string[l+1:] request_string = request_string[l+1:]
...@@ -162,6 +162,10 @@ def http(request_string, handle_errors=True): ...@@ -162,6 +162,10 @@ def http(request_string, handle_errors=True):
headers = [split_header(header) headers = [split_header(header)
for header in rfc822.Message(instream).headers] for header in rfc822.Message(instream).headers]
# Store request body without headers
instream = StringIO(instream.read())
for name, value in headers: for name, value in headers:
name = ('_'.join(name.upper().split('-'))) name = ('_'.join(name.upper().split('-')))
if name not in ('CONTENT_TYPE', 'CONTENT_LENGTH'): if name not in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment