RFR: 8272702: Resolving URI relative path with no / may lead to incorrect toString [v4]

Michael McMahon michaelm at openjdk.org
Tue Aug 9 16:18:39 UTC 2022


On Tue, 9 Aug 2022 11:02:31 GMT, KIRIYAMA Takuya <duke at openjdk.org> wrote:

>> Consider an authority component without trailing "/" as a base URI. When resolving a relative path against this base URI, the resulting URI is a concatenated URI without "/".
>> This behaviour should be fixed, which is rationalized by rfc3986#section-5.2.3.
>> Could you review this fix?
>
> KIRIYAMA Takuya has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8272702: Resolving URI relative path with no / may lead to incorrect toString

It seems like URI is currently behaving to spec. Even though the behavior is surprising, it's a corner case that isn't anticipated by the spec (or RFC 2396 for that matter). It looks like this was corrected in RFC 3986, but the whole resolution algorithm is specified differently in RFC 3986. I agree we would need to better understand the potential for incompatibility by making this change, eg how does it affect resolution + relativization round trips in these cases?

-------------

PR: https://git.openjdk.org/jdk/pull/8899


More information about the net-dev mailing list