Merge pull request #6 from notmyname/internal_proxy_fix

now deep-copies headers when making a copy of a request object
This commit is contained in:
tlohg 2011-08-02 08:01:22 -07:00
commit c9e43e0510
2 changed files with 3 additions and 1 deletions

View File

@ -55,10 +55,10 @@ def make_request_body_file(source_file, compress=True):
def webob_request_copy(orig_req, source_file=None, compress=True):
req_copy = orig_req.copy()
req_copy.headers = dict(orig_req.headers)
if source_file:
req_copy.body_file = make_request_body_file(source_file,
compress=compress)
req_copy.content_length = orig_req.content_length
return req_copy

View File

@ -78,6 +78,8 @@ class TestInternalProxy(unittest.TestCase):
self.assertEquals(req.path, req2.path)
self.assertEquals(req.path_info, req2.path_info)
self.assertFalse(req is req2)
self.assertEquals(req.headers, req2.headers)
self.assertFalse(req.headers is req2.headers)
def test_handle_request(self):
status_codes = [200]