We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d83f961 commit 3baf987Copy full SHA for 3baf987
2 files changed
lib/elixir/lib/uri.ex
@@ -903,7 +903,7 @@ defmodule URI do
903
@spec merge(t | binary, t | binary) :: t
904
def merge(uri, rel)
905
906
- def merge(%URI{host: nil}, _rel) do
+ def merge(%URI{scheme: nil}, _rel) do
907
raise ArgumentError, "you must merge onto an absolute URI"
908
end
909
lib/elixir/test/elixir/uri_test.exs
@@ -460,6 +460,11 @@ defmodule URITest do
460
"https://images.example.com/t/1600x/https://images.example.com/foo.jpg"
461
462
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
+
468
test "merge/2 (with RFC examples)" do
469
# These are examples from:
470
#
0 commit comments