method

normalize_path

Importance_1
normalize_path(path) public

Normalizes URI path.

Strips off trailing slash and ensures there is a leading slash. Also converts downcase URL encoded string to uppercase.

normalize_path("/foo")  # => "/foo"
normalize_path("/foo/") # => "/foo"
normalize_path("foo")   # => "/foo"
normalize_path("")      # => "/"
normalize_path("/%ab")  # => "/%AB"
Show source
Register or log in to add new notes.