You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ABNF rules of RFC 3986 permit a host with an ":" delimiter and an empty port, and section 3.2.3 says:
URI producers and normalizers should omit the port component
and its ":" delimiter if port is empty or if its value would
be the same as that of the scheme's default.
Currently RfcUrlParser captures an empty String as a port value, and UriComponentsBuilder accepts an empty String, but results in an IllegalStateException if the port is accessed with UriComponents#getPort.
By comparison both WhatWgUrlParser and java.net.URI ignore an empty port value and treat it as missing. We should explicitly handle that case in RfcUrlParser and in UriComponentsBuilder to the same effect.
Activity
github-actions commentedon Aug 7, 2026
Fixed via 11bb7b5
Polishing in UriComponentsTests
Ignore an empty port