mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
response headers should be a tupple.
This commit is contained in:
parent
54357b3487
commit
61840c3707
@ -42,7 +42,7 @@ class Request(object):
|
||||
self.client_address = client_address
|
||||
self.server_address = server_address
|
||||
self.response_status = None
|
||||
self.response_headers = {}
|
||||
self.response_headers = []
|
||||
self._version = 11
|
||||
self.parser = Parser()
|
||||
self.start_response_called = False
|
||||
@ -169,5 +169,5 @@ class Request(object):
|
||||
name = normalize_name(name)
|
||||
if not isinstance(value, basestring):
|
||||
value = str(value)
|
||||
self.response_headers[name] = value.strip()
|
||||
self.response_headers.append((name, value.strip()))
|
||||
self.start_response_called = True
|
||||
|
||||
@ -11,7 +11,7 @@ class Response(object):
|
||||
self.req = req
|
||||
self.sock = sock
|
||||
self.data = response
|
||||
self.headers = req.response_headers or {}
|
||||
self.headers = req.response_headers or []
|
||||
self.status = req.response_status
|
||||
self.SERVER_VERSION = req.SERVER_VERSION
|
||||
|
||||
@ -26,7 +26,7 @@ class Response(object):
|
||||
resp_head.append("Status: %s\r\n" % str(self.status))
|
||||
# always close the connection
|
||||
resp_head.append("Connection: close\r\n")
|
||||
for name, value in self.headers.items():
|
||||
for name, value in self.headers:
|
||||
resp_head.append("%s: %s\r\n" % (name, value))
|
||||
|
||||
write(self.sock, "%s\r\n" % "".join(resp_head))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user