Fix regression in ActionDispatch::Routing::RouteSet#recognize_path
This commit is contained in:
parent
e5522e9cc6
commit
1d3edd1c84
@ -884,7 +884,7 @@ def call(env)
|
||||
|
||||
def recognize_path(path, environment = {})
|
||||
method = (environment[:method] || "GET").to_s.upcase
|
||||
path = Journey::Router::Utils.normalize_path(path) unless path.include?("://")
|
||||
path = Journey::Router::Utils.normalize_path(path) unless path&.include?("://")
|
||||
extras = environment[:extras] || {}
|
||||
|
||||
begin
|
||||
|
@ -2129,6 +2129,7 @@ def test_recognize_path
|
||||
assert_equal({ controller: "geocode", action: "show", postalcode: "12345" }, @routes.recognize_path("/extended/geocode/12345"))
|
||||
|
||||
assert_equal({ controller: "news", action: "index" }, @routes.recognize_path("/", method: :get))
|
||||
assert_equal({ controller: "news", action: "index" }, @routes.recognize_path(nil))
|
||||
assert_equal({ controller: "news", action: "index", format: "rss" }, @routes.recognize_path("/news.rss", method: :get))
|
||||
|
||||
assert_raise(ActionController::RoutingError) { @routes.recognize_path("/none", method: :get) }
|
||||
|
Loading…
Reference in New Issue
Block a user