Open
Description
In rails 7, if there is no session in the request, it now defaults to an object that responds to enabled?
However, because rack.session is set to {} in webmock (WebMock::RackResponse#session), when webmock us used in a way that mounts this rails app (using to_rack), this causes a failure in the following line in the rails app
ActionDispatch::Flash::RequestMethods#commit_flash
return unless session.enabled?
where 'session' is defined as
def session
fetch_header(RACK_SESSION) do |k|
set_header RACK_SESSION, default_session
end
end
and fetch_header will return the session if already defined in env['rack.session'] therefore 'default_session' is not being called. The return value is therefore an empty hash which does not respond to enabled?
I am not sure if this is really a webmock issue or if rails are being a bit naughty setting rack.session to anything but a hash
Metadata
Metadata
Assignees
Labels
No labels