Add 'secure' for cookies when SSL enabled

pull/19/head
Omar Roth 2018-07-18 19:29:03 -05:00
rodzic 68d5ee95b3
commit 61e3c39ecd
1 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -663,7 +663,12 @@ post "/login" do |env|
host = URI.parse(env.request.headers["Host"]).host
login.cookies.each do |cookie|
cookie.secure = false
if Kemal.config.ssl
cookie.secure = true
else
cookie.secure = false
end
cookie.extension = cookie.extension.not_nil!.gsub(".youtube.com", host)
cookie.extension = cookie.extension.not_nil!.gsub("Secure; ", "")
end