This commit is contained in:
Taylor Wilsdon
2026-03-01 17:47:00 -05:00
parent cd326d0f2d
commit 5af66ee0d2

View File

@@ -100,19 +100,11 @@ def _wrap_well_known_endpoint(endpoint, etag: str):
elif message["type"] == "http.response.body": elif message["type"] == "http.response.body":
body_parts.append(message.get("body", b"")) body_parts.append(message.get("body", b""))
await endpoint(request.scope, request._receive, send) await endpoint(request.scope, request.receive, send)
headers = { response = Response(content=b"".join(body_parts), status_code=status_code)
(k.decode() if isinstance(k, bytes) else k): ( if raw_headers:
v.decode() if isinstance(v, bytes) else v response.raw_headers = raw_headers
)
for k, v in raw_headers
}
response = Response(
content=b"".join(body_parts),
status_code=status_code,
headers=headers,
)
response.headers["Cache-Control"] = "no-store, must-revalidate" response.headers["Cache-Control"] = "no-store, must-revalidate"
response.headers["ETag"] = etag response.headers["ETag"] = etag
return response return response