mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Remove SSL redirect
This commit is contained in:
parent
330ffb803f
commit
97bd1da2a2
1 changed files with 0 additions and 21 deletions
|
@ -5294,27 +5294,6 @@ error 500 do |env|
|
|||
templated "error"
|
||||
end
|
||||
|
||||
# Add redirect if SSL is enabled
|
||||
if Kemal.config.ssl
|
||||
spawn do
|
||||
server = HTTP::Server.new do |env|
|
||||
redirect_url = "https://#{env.request.host}#{env.request.path}"
|
||||
if env.request.query
|
||||
redirect_url += "?#{env.request.query}"
|
||||
end
|
||||
|
||||
if config.hsts
|
||||
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload"
|
||||
end
|
||||
env.response.headers["Location"] = redirect_url
|
||||
env.response.status_code = 301
|
||||
end
|
||||
|
||||
server.bind_tcp "0.0.0.0", 80
|
||||
server.listen
|
||||
end
|
||||
end
|
||||
|
||||
static_headers do |response, filepath, filestat|
|
||||
response.headers.add("Cache-Control", "max-age=2629800")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue