Skip to content

Instantly share code, notes, and snippets.

@lukaszx0
Last active August 29, 2015 14:01
Show Gist options
  • Save lukaszx0/1e834a91d03e2493a15e to your computer and use it in GitHub Desktop.
Save lukaszx0/1e834a91d03e2493a15e to your computer and use it in GitHub Desktop.
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index a8368b6..abe4d71 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -500,11 +500,11 @@ module ActionDispatch
end
def recognize_path(path, environment = {})
- method = (environment[:method] || "GET").to_s.upcase
+ environment[:method] = (environment[:method] || "GET").to_s.upcase
path = Rack::Mount::Utils.normalize_path(path) unless path =~ %r{://}
begin
- env = Rack::MockRequest.env_for(path, {:method => method})
+ env = Rack::MockRequest.env_for(path, environment)
rescue URI::InvalidURIError => e
raise ActionController::RoutingError, e.message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment