fix: Drop Content-Encoding header from proxy response, fix Content-Length
This commit is contained in:
parent
d3b4576d24
commit
62283b9cdd
1 changed files with 4 additions and 0 deletions
4
app.py
4
app.py
|
@ -49,6 +49,8 @@ def create_proxy_response(url, headers=None):
|
|||
"trailers",
|
||||
"transfer-encoding",
|
||||
"upgrade",
|
||||
"content-encoding",
|
||||
"content-length",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -57,6 +59,8 @@ def create_proxy_response(url, headers=None):
|
|||
content = re.sub(
|
||||
PATTERN, request.host.encode("utf-8"), content
|
||||
)
|
||||
|
||||
filtered_headers["Content-Length"] = str(len(content))
|
||||
|
||||
return Response(content, status=response.status_code, headers=filtered_headers)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue