json data types

This commit is contained in:
Roy Olav Purser 2021-05-12 00:27:12 +02:00
parent 459cfe231d
commit 0bde426fea
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -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)