Skip to content

Commit

Permalink
fix(web): Ensure that header values are strings (frappe#28760)
Browse files Browse the repository at this point in the history
  • Loading branch information
cogk authored Dec 12, 2024
1 parent 0c8e49b commit 50020cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frappe/website/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,14 @@ def build_response(path, data, http_status_code, headers: dict | None = None):
response = Response()
response.data = set_content_type(response, data, path)
response.status_code = http_status_code
response.headers["X-Page-Name"] = cstr(path.encode("ascii", errors="xmlcharrefreplace"))
response.headers["X-Page-Name"] = cstr(cstr(path).encode("ascii", errors="xmlcharrefreplace"))
response.headers["X-From-Cache"] = frappe.local.response.from_cache or False

add_preload_for_bundled_assets(response)

if headers:
for key, val in headers.items():
response.headers[key] = cstr(val.encode("ascii", errors="xmlcharrefreplace"))
response.headers[key] = cstr(cstr(val).encode("ascii", errors="xmlcharrefreplace"))

return response

Expand Down

0 comments on commit 50020cf

Please sign in to comment.