Skip to content
Snippets Groups Projects
Unverified Commit 3447bd2f authored by Cecylia Bocovich's avatar Cecylia Bocovich Committed by GitHub
Browse files

Monkey patch Rack::Session to send secure cookies to onions (#15725)

parent 5aa66fcc
No related branches found
No related tags found
No related merge requests found
......@@ -13,3 +13,13 @@ module ActionDispatch
end
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment