diff --git a/files/__main__.py b/files/__main__.py index d2991b28c..9628f0d13 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -254,8 +254,13 @@ def after_request(response): print(e) abort(500) + response.headers.add('Access-Control-Allow-Headers', "Origin, X-Requested-With, Content-Type, Accept, x-auth") response.headers.remove("Cache-Control") response.headers.add("Cache-Control", "public, maxage=600") + response.headers.add("Strict-Transport-Security", "max-age=31536000") + response.headers.add("Referrer-Policy", "same-origin") + response.headers.add("Feature-Policy", "geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment 'none';") + if not request.path.startswith("/embed/"): response.headers.add("X-Frame-Options", "deny") return response