Compare commits

...

1 Commits

Author SHA1 Message Date
Matt Todd
ca91f2194e Exclude request from 404 exception env inspection
Yeah, this is ghetto, but it makes github/github#15020 simpler.

Right now, we have to store the `request` object in `Thread.current` for constraints-based routing if we want access to the request when running our constraint match.

See github/github#14468 for additional background, where the `request` was removed from the `env` because it was causing unexpected needles for all 404s.

NOTE: This `env` is not the same as `request.env`, it's a subset produced by [`extract_request_environment`](685cb901fc/actionpack/lib/action_controller/routing/route_set.rb (L442)).

cc @github/discussions @github/rails
2013-09-16 16:07:01 -07:00

View File

@@ -63,7 +63,7 @@ module ActionController
elsif !allows.empty?
raise MethodNotAllowed.new(*allows)
else
raise RoutingError, "No route matches #{path.inspect} with #{environment.inspect}"
raise RoutingError, "No route matches #{path.inspect} with #{environment.except(:request).inspect}"
end
end