diff --git a/lib/routing_filter/adapters/routers/journey.rb b/lib/routing_filter/adapters/routers/journey.rb index 39b7a3a..ad8f718 100644 --- a/lib/routing_filter/adapters/routers/journey.rb +++ b/lib/routing_filter/adapters/routers/journey.rb @@ -8,15 +8,16 @@ def find_routes(env) filter_parameters end - super(env).map do |match, parameters, route| - [ match, parameters.merge(filter_parameters), route ] - end.tap do |match, parameters, route| - # restore the original path + super(env) do |match, parameters, route| + parameters = parameters.merge(filter_parameters) + if env.is_a?(Hash) env['PATH_INFO'] = original_path else env.path_info = original_path end + + yield [match, parameters, route] end end end diff --git a/routing-filter.gemspec b/routing-filter.gemspec index 804f2ea..0496b0e 100644 --- a/routing-filter.gemspec +++ b/routing-filter.gemspec @@ -1,7 +1,7 @@ $:.unshift File.expand_path('../lib', __FILE__) require 'routing_filter/version' -rails_version = ['>= 6.1'] +rails_version = ['>= 7.1'] Gem::Specification.new do |s| s.name = "routing-filter"