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
648
648
scheme = String . downcase ( scheme , :ascii )
649
649
650
650
case map do
651
- % { port: _ } ->
651
+ % { port: port } when port != :undefined ->
652
652
% { uri | scheme: scheme }
653
653
654
654
% { } ->
Original file line number Diff line number Diff line change @@ -279,6 +279,31 @@ defmodule URITest do
279
279
end
280
280
end
281
281
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
+
282
307
test "default_port/1,2" do
283
308
assert URI . default_port ( "http" ) == 80
284
309
You can’t perform that action at this time.
0 commit comments