Merge pull request #5131 from achillesrasquinha/py3
[FIX] gunicorn fails to read byte response headers, convert to strings
This commit is contained in:
commit
de88d2f568
1 changed files with 3 additions and 3 deletions
|
|
@ -106,12 +106,12 @@ def build_response(path, data, http_status_code, headers=None):
|
|||
response = Response()
|
||||
response.data = set_content_type(response, data, path)
|
||||
response.status_code = http_status_code
|
||||
response.headers[b"X-Page-Name"] = path.encode("utf-8")
|
||||
response.headers[b"X-From-Cache"] = frappe.local.response.from_cache or False
|
||||
response.headers["X-Page-Name"] = path.encode("utf-8")
|
||||
response.headers["X-From-Cache"] = frappe.local.response.from_cache or False
|
||||
|
||||
if headers:
|
||||
for key, val in iteritems(headers):
|
||||
response.headers[bytes(key.encode("utf-8"))] = val.encode("utf-8")
|
||||
response.headers[str(key.encode("utf-8"))] = val.encode("utf-8")
|
||||
|
||||
return response
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue