refac
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user