File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -903,7 +903,7 @@ defmodule URI do
903903 @ spec merge ( t | binary , t | binary ) :: t
904904 def merge ( uri , rel )
905905
906- def merge ( % URI { host : nil } , _rel ) do
906+ def merge ( % URI { scheme : nil } , _rel ) do
907907 raise ArgumentError , "you must merge onto an absolute URI"
908908 end
909909
Original file line number Diff line number Diff line change @@ -460,6 +460,11 @@ defmodule URITest do
460460 "https://images.example.com/t/1600x/https://images.example.com/foo.jpg"
461461 end
462462
463+ test "merge/2 with host-less URIs" do
464+ assert URI . merge ( "tag:example" , "foo" ) |> to_string == "tag:foo"
465+ assert URI . merge ( "tag:example" , "#fragment" ) |> to_string == "tag:example#fragment"
466+ end
467+
463468 test "merge/2 (with RFC examples)" do
464469 # These are examples from:
465470 #
You can’t perform that action at this time.
0 commit comments