URIs.jl icon indicating copy to clipboard operation
URIs.jl copied to clipboard

Invalid port pattern is recognized in the sense of RFC3986

Open o314 opened this issue 3 years ago • 2 comments

u = URI("//foo.com:bar")
using Test
@test u.port == "bar"

breaks the parsing of port as expected from https://www.ietf.org/rfc/rfc3986.html#section-3.2.3

The port subcomponent of authority is designated by an optional port number in decimal following the host and delimited from it by a single colon (":") character.

 port        = *DIGIT

The regex part is too broad @ https://github.com/JuliaWeb/URIs.jl/blob/master/src/URIs.jl#L94

o314 avatar Aug 02 '22 06:08 o314

AKA rfc3986 / appendix b does not conform to rfc3986 / appendix A & section 3.2.3

o314 avatar Aug 02 '22 06:08 o314

Yeah, this would be good to fix.

quinnj avatar Aug 28 '22 00:08 quinnj