fix(web): Ensure that header values are strings (#28760)
This commit is contained in:
parent
0c8e49b72b
commit
50020cffda
1 changed files with 2 additions and 2 deletions
|
|
@ -546,14 +546,14 @@ def build_response(path, data, http_status_code, headers: dict | None = None):
|
||||||
response = Response()
|
response = Response()
|
||||||
response.data = set_content_type(response, data, path)
|
response.data = set_content_type(response, data, path)
|
||||||
response.status_code = http_status_code
|
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
|
response.headers["X-From-Cache"] = frappe.local.response.from_cache or False
|
||||||
|
|
||||||
add_preload_for_bundled_assets(response)
|
add_preload_for_bundled_assets(response)
|
||||||
|
|
||||||
if headers:
|
if headers:
|
||||||
for key, val in headers.items():
|
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
|
return response
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue