diff --git a/main.py b/main.py index d562e1b..2e88249 100644 --- a/main.py +++ b/main.py @@ -51,6 +51,10 @@ if not os.path.isdir('certs'): def send_report(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') def faviconPNG(): return send_from_directory('templates/assets/img', 'favicon.png') diff --git a/templates/https.js b/templates/https.js new file mode 100644 index 0000000..4d0083b --- /dev/null +++ b/templates/https.js @@ -0,0 +1,6 @@ +if (location.protocol !== 'https:') { + location.replace(`https:${location.href.substring(location.protocol.length)}`); +} +else{ +console.log("Already Https"); +}