Skip to content

Commit

Permalink
Fix URI.parse triple slash path
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Jul 3, 2018
1 parent f7a0e31 commit 42c9781
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/std/uri_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe "URI" do
assert_uri("http:..", scheme: "http", path: "..")
assert_uri("http://host/!$&'()*+,;=:@[hello]", scheme: "http", host: "host", path: "/!$&'()*+,;=:@[hello]")
assert_uri("http://example.com//foo", scheme: "http", host: "example.com", path: "//foo")
assert_uri("///foo", host: "", path: "/foo")

pending "path with escape" do
assert_uri("http://www.example.com/file%20one%26two", scheme: "http", host: "example.com", path: "/file one&two", raw_path: "/file%20one%26two")
Expand Down
1 change: 1 addition & 0 deletions src/uri/uri_parser.cr
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class URI
def parse_relative_slash
if @input[@ptr + 1] === '/'
@ptr += 1
@uri.host ||= ""
parse_authority
else
parse_path
Expand Down

0 comments on commit 42c9781

Please sign in to comment.