From f76f084c01dcf5d0524148a4e74b112cbaa579db Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sat, 29 May 2021 15:55:13 +0200 Subject: [PATCH] disable redirect for head --- backend/stream.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/stream.py b/backend/stream.py index 0a46552..bc40e54 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -269,7 +269,9 @@ class MainHandler(tornado.web.RequestHandler): upstream_proxy = await handler.proxy.proxy_url(upstream, None) ctype = await handler.proxy.content_type(upstream_proxy) self.set_header("Content-Type", ctype) - self.redirect(upstream_proxy, status=303) + self.set_header("Content-Location", upstream_proxy) + if redir: + self.redirect(upstream_proxy, status=303) async def get(self): await self.handle_any(True) async def head(self):