mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Only use HSTS if SSL is enabled
This commit is contained in:
parent
31d1315c60
commit
d664d6b371
1 changed files with 4 additions and 4 deletions
|
@ -160,10 +160,6 @@ get "/" do |env|
|
||||||
templated "index"
|
templated "index"
|
||||||
end
|
end
|
||||||
|
|
||||||
before_all do |env|
|
|
||||||
env.response.headers.add("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload")
|
|
||||||
end
|
|
||||||
|
|
||||||
get "/watch" do |env|
|
get "/watch" do |env|
|
||||||
if env.params.query["v"]?
|
if env.params.query["v"]?
|
||||||
id = env.params.query["v"]
|
id = env.params.query["v"]
|
||||||
|
@ -356,6 +352,10 @@ if Kemal.config.ssl && redirect
|
||||||
|
|
||||||
server.listen
|
server.listen
|
||||||
end
|
end
|
||||||
|
|
||||||
|
before_all do |env|
|
||||||
|
env.response.headers.add("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
static_headers do |response, filepath, filestat|
|
static_headers do |response, filepath, filestat|
|
||||||
|
|
Loading…
Reference in a new issue