From 0bde426feabb930e7529a96bf8f9124e4c9fe7dd Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 12 May 2021 00:27:12 +0200 Subject: [PATCH] json data types --- stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stream.py b/stream.py index f76d364..e03214a 100755 --- a/stream.py +++ b/stream.py @@ -211,9 +211,9 @@ class MainHandler(tornado.web.RequestHandler): ldata["proxied"] = isinstance(proxy.proxy, str) links = [ldata] resp = requests.post(proxy_server, json=links) - if isinstance(resp.text, list): + if isinstance(resp.text, str): new_links = json.loads(resp.text) - if len(new_links) == 1: + if isinstance(new_links, list) and len(new_links) == 1: upstream = new_links.pop() if data is None: self.redirect(upstream, status=303)