diff --git a/rootfs/standard/var/www/mynode/mynode.py b/rootfs/standard/var/www/mynode/mynode.py index 4b52fed3..a86bfd4c 100644 --- a/rootfs/standard/var/www/mynode/mynode.py +++ b/rootfs/standard/var/www/mynode/mynode.py @@ -847,12 +847,17 @@ def before_request(): if is_https_forced(): if not request.is_secure: url = request.url.replace('http://', 'https://', 1) - code = 301 + code = 302 + app.logger.info("Redirecting to HTTPS ({})".format(url)) return redirect(url, code=code) # Disable browser caching @app.after_request def set_response_headers(response): + # Prevents 301 from saving forever + response.headers['Cache-Control'] = 'no-store' + + # No Caching #response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate' #response.headers['Pragma'] = 'no-cache' #response.headers['Expires'] = '0'