Skip to content
Snippets Groups Projects
Unverified Commit 3f852313 authored by Justin Tracey's avatar Justin Tracey Committed by GitHub
Browse files

use host instead of headers to make Rack happy (#15741)

"headers" is provided by Rails, Rack can't rely on it
parent 9c273c2a
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ module ActionDispatch
# Monkey-patch ActionDispatch to serve secure cookies to Tor Hidden Service
# users. Otherwise, ActionDispatch would drop the cookie over HTTP.
def write_cookie?(*)
request.headers['Host'].ends_with?('.onion') || super
request.host.ends_with?('.onion') || super
end
end
end
......@@ -17,7 +17,7 @@ ActionDispatch::Cookies::CookieJar.prepend(ActionDispatch::CookieJarExtensions)
module Rack
module SessionPersistedExtensions
def security_matches?(request, options)
request.headers['Host'].ends_with?('.onion') || super
request.host.ends_with?('.onion') || super
end
end
end
......
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