Tweak media proxy

This commit is contained in:
Thomas Sileo 2019-09-07 09:47:58 +02:00
parent 31902ddb46
commit d035e521d3

3
app.py
View file

@ -271,7 +271,8 @@ def proxy(scheme: str, url: str) -> Any:
req_headers = { req_headers = {
k: v k: v
for k, v in dict(request.headers).items() for k, v in dict(request.headers).items()
if k.lower() not in ["host", "cookie"] if k.lower() not in ["host", "cookie", "", "x-forwarded-for", "x-real-ip"]
and not k.lower().startswith("broxy-")
} }
req_headers["Host"] = urlparse(url).netloc req_headers["Host"] = urlparse(url).netloc
resp = requests.get(url, stream=True, headers=req_headers) resp = requests.get(url, stream=True, headers=req_headers)