This commit is contained in:
Roy Olav Purser 2021-05-14 15:52:22 +02:00
parent 85b38527bc
commit d12e9ca882
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -322,21 +322,6 @@ class MainHandler(tornado.web.RequestHandler):
self.set_header("Content-Type", "application/vnd.apple.mpegurl")
else:
self.set_header("Content-Type", ctype)
ldata = {}
ldata["upstream"] = upstream
ldata["proxy"] = handler.proxy.proxy
ldata["proxied"] = isinstance(handler.proxy.proxy, str)
links = [ldata]
if isinstance(proxy_server, str):
try:
resp = requests.post(proxy_server, json=links)
if isinstance(resp.text, str):
new_links = json.loads(resp.text)
if isinstance(new_links, list) and len(new_links) == 1:
upstream = new_links.pop()
except Exception as e:
logger.info(e)
if data is None:
if redir:
upstream = await handler.proxy.proxy_url(upstream, None)
self.redirect(upstream, status=303)