From c1f5070de591367114030e5c6a3951692d77aa55 Mon Sep 17 00:00:00 2001 From: Alex Kelly Date: Sun, 5 Jan 2020 20:35:56 -0500 Subject: [PATCH] moved default to ipfs, closes #3, (prior checkin closes #1) --- chainlink.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chainlink.py b/chainlink.py index 86f663b..6f1e882 100755 --- a/chainlink.py +++ b/chainlink.py @@ -38,9 +38,9 @@ def root(): @app.route("/") @app.route("//") def redirectDomain(domain, action=None): - apiurl =f'https://unstoppabledomains.com/api/v1/{domain}' + apiurl = f'https://unstoppabledomains.com/api/v1/{domain}' dnslookup = requests.get(apiurl) - if action == None or action == 'redir': + if action == 'redir': try: if dnslookup.status_code == 200: body = json.loads(dnslookup.content) @@ -54,7 +54,7 @@ def redirectDomain(domain, action=None): return f'Error making call to {apiurl} for {domain}' except KeyError: return f'Did not find a redirect for {domain}' - elif action == 'html': + elif action is None or action == 'html': # TODO: clean this up by functionalizing this call. It's basically the same as above if dnslookup.status_code == 200: body = json.loads(dnslookup.content)