Add hardened headers to user-uploaded files (#25756)
This commit is contained in:
1 parent
000b835803
commit
fed9cbfd2b
2 files changed
+7
No files matched your search
@@ -32,6 +32,11 @@ class PublicFileServerMiddleware
|
||||
end
|
||||
end
|
||||
|
||||
# Override the default CSP header set by the CSP middleware
|
||||
headers['Content-Security-Policy'] = "default-src 'none'; form-action 'none'" if request_path.start_with?(paperclip_root_url)
|
||||
|
||||
headers['X-Content-Type-Options'] = 'nosniff'
|
||||
|
||||
[status, headers, response]
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user