mirror of
https://github.com/iv-org/instances-api.git
synced 2025-01-26 23:37:05 -05:00
Add security headers
This commit is contained in:
parent
798b2c282f
commit
047d53bfb1
@ -81,6 +81,13 @@ spawn do
|
||||
end
|
||||
end
|
||||
|
||||
before_all do |env|
|
||||
env.response.headers["X-XSS-Protection"] = "1; mode=block"
|
||||
env.response.headers["X-Content-Type-Options"] = "nosniff"
|
||||
env.response.headers["Referrer-Policy"] = "same-origin"
|
||||
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload"
|
||||
end
|
||||
|
||||
get "/" do |env|
|
||||
sort_by = env.params.query["sort_by"]?
|
||||
sort_by ||= "users-reverse"
|
||||
|
Loading…
x
Reference in New Issue
Block a user