fix: Inject ssl based on host only

This commit is contained in:
Nathan Woodburn 2024-03-27 20:37:02 +11:00
parent 1b6536d8ae
commit dcc28483e3
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ def index():
with open(f'sites/{host}.json') as file: with open(f'sites/{host}.json') as file:
data = json.load(file) data = json.load(file)
return render.site(data, True) return render.site(data, host)
return redirect(f'https://{DOMAINS[0]}') return redirect(f'https://{DOMAINS[0]}')
@app.route('/site') @app.route('/site')

View File

@ -91,7 +91,7 @@ def site(data, injectSSL = False):
ssl = '' ssl = ''
if injectSSL: if injectSSL:
ssl = '<script src="https://nathan.woodburn/https.js" async=""></script>' ssl = f'<script src="https://{injectSSL}/https.js" async=""></script>'
page = "page.html" page = "page.html"
if data['image'] == "": if data['image'] == "":
page = "page_no_image.html" page = "page_no_image.html"