mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-22 14:53:15 +00:00
Monkey patch Rack::Session to send secure cookies to onions (#15725)
This commit is contained in:
parent
5aa66fccb5
commit
3447bd2f80
|
@ -13,3 +13,13 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
|
|
||||||
ActionDispatch::Cookies::CookieJar.prepend(ActionDispatch::CookieJarExtensions)
|
ActionDispatch::Cookies::CookieJar.prepend(ActionDispatch::CookieJarExtensions)
|
||||||
|
|
||||||
|
module Rack
|
||||||
|
module SessionPersistedExtensions
|
||||||
|
def security_matches?(request, options)
|
||||||
|
request.headers['Host'].ends_with?('.onion') || super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Rack::Session::Abstract::Persisted.prepend(Rack::SessionPersistedExtensions)
|
||||||
|
|
Loading…
Reference in a new issue