From 2cd0835208197247fd46356fd3a1e2ebbc82b1b7 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Tue, 20 Aug 2019 22:55:55 +0200 Subject: [PATCH] Fix the media proxy --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index a41bcf2..e2d935d 100644 --- a/app.py +++ b/app.py @@ -258,7 +258,7 @@ def proxy(scheme: str, url: str) -> Any: } req_headers["Host"] = urlparse(url).netloc resp = requests.get(url, stream=True, headers=req_headers) - app.logger.info(f"proxied req {url}: {resp!r}") + app.logger.info(f"proxied req {url} {req_headers}: {resp!r}") def data(): for chunk in resp.raw.stream(decode_content=False): @@ -278,7 +278,7 @@ def proxy(scheme: str, url: str) -> Any: "last-modified", ] } - return Response(data(), headers=resp_headers) + return Response(data(), headers=resp_headers, status=resp.status_code) @app.route("/media/")