Permalink
Browse files

support for handling mutliple headers with the same name in applicati…

…on.request
  • Loading branch information...
1 parent ee08318 commit 0e2f300d2298163e9721710356aa3f8e96225055 @anandology anandology committed Dec 10, 2008
Showing with 3 additions and 2 deletions.
  1. +1 −1 test/browser.py
  2. +1 −0 web/application.py
  3. +1 −1 web/browser.py
View
@@ -40,7 +40,7 @@ def testCookies(self):
b = app.browser()
b.open('http://0.0.0.0/setcookie?x=1&y=2')
b.open('http://0.0.0.0/cookie')
- self.assertEquals(b.data, 'x')
+ self.assertEquals(b.data, 'x,y')
def testNotfound(self):
b = app.browser()
View
@@ -188,6 +188,7 @@ def request(self, localpart='/', method='GET', data=None,
def start_response(status, headers):
response.status = status
response.headers = dict(headers)
+ response.header_items = headers
response.data = "".join(self.wsgifunc(cleanup_threadlocal=False)(env, start_response))
return response
View
@@ -221,7 +221,7 @@ def https_open(self, req):
https_request = urllib2.HTTPHandler.do_request_
def _make_response(self, result, url):
- data = "\r\n".join(["%s: %s" % (k, v) for k, v in result.headers.items()])
+ data = "\r\n".join(["%s: %s" % (k, v) for k, v in result.header_items])
headers = httplib.HTTPMessage(StringIO(data))
response = urllib.addinfourl(StringIO(result.data), headers, url)
code, msg = result.status.split(None, 1)

0 comments on commit 0e2f300

Please sign in to comment.