From 60b260c86fb32bcb4eb5f35f1d1067042743b693 Mon Sep 17 00:00:00 2001 From: Alex Kelly Date: Mon, 6 Jan 2020 14:31:05 -0500 Subject: [PATCH] Handle demo URLs and redirect them to root --- chainlink.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chainlink.py b/chainlink.py index ffe82e5..64edcc3 100755 --- a/chainlink.py +++ b/chainlink.py @@ -1,6 +1,6 @@ #!/usr/bin/env python """Utilize crypto domains DNS and either redirect, or display information.""" -from bottle import Bottle, run, response, request, static_file +from bottle import Bottle, run, response, request, static_file, redirect import json import requests import json2html @@ -60,6 +60,8 @@ def root(): def redirectDomain(domain, action=None): """Handle the actual redirect for the domain queried""" lookupResult = domainLookup(domain) + if domain == 'yourdomain.crypto' or domain == 'yourdomain.zil': + redirect('/') if lookupResult: redirect_url = lookupResult['ipfs']['redirect_domain'] ipfs_hash = lookupResult['ipfs']['html']