mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Add 'secure' for cookies when SSL enabled
This commit is contained in:
parent
68d5ee95b3
commit
61e3c39ecd
1 changed files with 6 additions and 1 deletions
|
@ -663,7 +663,12 @@ post "/login" do |env|
|
||||||
host = URI.parse(env.request.headers["Host"]).host
|
host = URI.parse(env.request.headers["Host"]).host
|
||||||
|
|
||||||
login.cookies.each do |cookie|
|
login.cookies.each do |cookie|
|
||||||
|
if Kemal.config.ssl
|
||||||
|
cookie.secure = true
|
||||||
|
else
|
||||||
cookie.secure = false
|
cookie.secure = false
|
||||||
|
end
|
||||||
|
|
||||||
cookie.extension = cookie.extension.not_nil!.gsub(".youtube.com", host)
|
cookie.extension = cookie.extension.not_nil!.gsub(".youtube.com", host)
|
||||||
cookie.extension = cookie.extension.not_nil!.gsub("Secure; ", "")
|
cookie.extension = cookie.extension.not_nil!.gsub("Secure; ", "")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue