Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/elixir/lib/uri.ex
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ defmodule URI do
%{rel | path: remove_dot_segments_from_path(rel.path)}
end

def merge(base, %URI{host: host} = rel) when host != nil do
def merge(%URI{} = base, %URI{host: host} = rel) when host != nil do
%{rel | scheme: base.scheme, path: remove_dot_segments_from_path(rel.path)}
end

Expand Down
3 changes: 3 additions & 0 deletions lib/elixir/test/elixir/uri_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ defmodule URITest do
assert URI.merge("http://google.com/foo", "//example.com/baz")
|> to_string == "http://example.com/baz"

assert URI.merge("http://google.com/foo", URI.new!("//example.com/baz"))
|> to_string == "http://example.com/baz"

assert URI.merge("http://google.com/foo", "//example.com/.././bar/../../../baz")
|> to_string == "http://example.com/baz"

Expand Down
Loading