File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -648,7 +648,7 @@ defmodule URI do
648648 scheme = String . downcase ( scheme , :ascii )
649649
650650 case map do
651- % { port: _ } ->
651+ % { port: port } when port != :undefined ->
652652 % { uri | scheme: scheme }
653653
654654 % { } ->
Original file line number Diff line number Diff line change @@ -279,6 +279,31 @@ defmodule URITest do
279279 end
280280 end
281281
282+ test "http://http://http://@http://http://?http://#http://" do
283+ assert URI . parse ( "http://http://http://@http://http://?http://#http://" ) ==
284+ % URI {
285+ scheme: "http" ,
286+ authority: "http:" ,
287+ userinfo: nil ,
288+ host: "http" ,
289+ port: 80 ,
290+ path: "//http://@http://http://" ,
291+ query: "http://" ,
292+ fragment: "http://"
293+ }
294+
295+ assert URI . new! ( "http://http://http://@http://http://?http://#http://" ) ==
296+ % URI {
297+ scheme: "http" ,
298+ userinfo: nil ,
299+ host: "http" ,
300+ port: 80 ,
301+ path: "//http://@http://http://" ,
302+ query: "http://" ,
303+ fragment: "http://"
304+ }
305+ end
306+
282307 test "default_port/1,2" do
283308 assert URI . default_port ( "http" ) == 80
284309
You can’t perform that action at this time.
0 commit comments