mirror of
https://github.com/iv-org/instances-api.git
synced 2025-05-10 18:45:13 -04:00
Add security headers
This commit is contained in:
parent
798b2c282f
commit
047d53bfb1
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue