fix: Add https.js

This commit is contained in:
Nathan Woodburn 2024-03-27 20:41:24 +11:00
parent dcc28483e3
commit e844936a00
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,10 @@ if not os.path.isdir('certs'):
def send_report(path): def send_report(path):
return send_from_directory('templates/assets', path) return send_from_directory('templates/assets', path)
@app.route('/https.js')
def httpsJS():
return send_from_directory('templates', 'https.js')
@app.route('/favicon.png') @app.route('/favicon.png')
def faviconPNG(): def faviconPNG():
return send_from_directory('templates/assets/img', 'favicon.png') return send_from_directory('templates/assets/img', 'favicon.png')

6
templates/https.js Normal file
View File

@ -0,0 +1,6 @@
if (location.protocol !== 'https:') {
location.replace(`https:${location.href.substring(location.protocol.length)}`);
}
else{
console.log("Already Https");
}