Skip to content

Commit

Permalink
FIX - rails_route_from_url would fail if path contained unicode chara…
Browse files Browse the repository at this point in the history
…cters
  • Loading branch information
jbrw committed Aug 28, 2020
1 parent 84dba3c commit e1896f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/url_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def self.escape_uri(uri)
end

def self.rails_route_from_url(url)
path = URI.parse(url).path
path = URI.parse(encode(url)).path
Rails.application.routes.recognize_path(path)
end

Expand Down

1 comment on commit e1896f7

@discoursereviewbot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robin Ward posted:

We should add a test for this.

Please sign in to comment.