mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-22 05:27:21 +00:00
Remove SSL redirect
This commit is contained in:
parent
330ffb803f
commit
97bd1da2a2
@ -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 New Issue
Block a user