This commit is contained in:
11
server.py
11
server.py
@@ -378,19 +378,28 @@ def index():
|
||||
year = datetime.datetime.now().year
|
||||
hns_scripts = '<script src="https://gday.hnsau/handshake.js" domain="gday.hnsau" async></script><script src="https://gday.hnsau/https.js" async></script>'
|
||||
|
||||
if 'localhost' in request.host or '127.0.0.1' in request.host:
|
||||
hns_scripts = ''
|
||||
|
||||
tld = request.host.split('.')[-1]
|
||||
if tld not in tlds and 'localhost' not in tld:
|
||||
return render_template('index.html',year=year, handshake_scripts=hns_scripts)
|
||||
|
||||
hns_scripts = '<script src="https://gday.hnsau/https.js" async></script>'
|
||||
if 'localhost' in tld:
|
||||
tld = tlds[0]
|
||||
hns_scripts = '<script src="https://gday.hnsau/https.js" async></script>'
|
||||
hns_scripts = ''
|
||||
|
||||
return render_template('/tlds/'+tld+'.html',year=year, handshake_scripts=hns_scripts)
|
||||
|
||||
@app.route('/<path:path>')
|
||||
def catch_all(path):
|
||||
year = datetime.datetime.now().year
|
||||
hns_scripts = '<script src="https://gday.hnsau/handshake.js" domain="gday.hnsau" async></script><script src="https://gday.hnsau/https.js" async></script>'
|
||||
|
||||
if 'localhost' in request.host or '127.0.0.1' in request.host:
|
||||
hns_scripts = ''
|
||||
|
||||
# If file exists, load it
|
||||
if os.path.isfile('templates/' + path):
|
||||
return render_template(path, year=year, handshake_scripts=hns_scripts)
|
||||
|
||||
Reference in New Issue
Block a user