Skip to content

Commit

Permalink
Merge pull request #47306 from zzak/re-47129
Browse files Browse the repository at this point in the history
Follow up to HTTP::Request#route_uri_pattern
  • Loading branch information
byroot committed Dec 11, 2023
2 parents 0915a3e + 0c71b60 commit 572f475
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/http/request.rb
Expand Up @@ -146,7 +146,7 @@ def request_method
end

# Returns the URI pattern of the matched route for the request,
# using the same format as `bin/rails routes`:
# using the same format as <tt>bin/rails routes</tt>:
#
# request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)"
def route_uri_pattern
Expand Down
5 changes: 5 additions & 0 deletions actionpack/test/controller/routing_test.rb
Expand Up @@ -360,6 +360,11 @@ def test_route_uri_pattern
"/:controller(/:action(/:id))(.:format)",
controller.request.route_uri_pattern
)

assert_equal(
"/:controller(/:action(/:id))(.:format)",
controller.request.get_header("action_dispatch.route_uri_pattern")
)
end

def test_route_with_colon_first
Expand Down

0 comments on commit 572f475

Please sign in to comment.