RFR 8245245 : WebSocket can loose the URL encoding of URI query parameters

Rahul Yadav rahul.r.yadav at oracle.com
Fri Jun 26 15:42:34 UTC 2020


Pavel,

That scenario is already handled, the existing behavior is if there is a 
fragment, an exception is thrown.
That hasn't changed.

  344     private static URI checkURI(URI uri) {
  345         String scheme = uri.getScheme();
  346         if (!("ws".equalsIgnoreCase(scheme) || "wss".equalsIgnoreCase(scheme)))
  347             throw illegal("invalid URI scheme: " + scheme);
  348         if (uri.getHost() == null)
  349             throw illegal("URI must contain a host: " + uri);
  350         if (uri.getFragment() != null)
  351             throw illegal("URI must not contain a fragment: " + uri);
  352         return uri;
  353     }
  354



- rahul


On 26/06/2020 14:38, Pavel Rappo wrote:
> Rahul,
>
> Won't that start retaining the URL fragment? From https://tools.ietf.org/html/rfc6455#section-3
>
>     Fragment identifiers are meaningless in the context of WebSocket URIs
>     and MUST NOT be used on these URIs.  As with any URI scheme, the
>     character "#", when not indicating the start of a fragment, MUST be
>     escaped as %23.
>
> -Pavel
>
>> On 26 Jun 2020, at 13:03, Rahul Yadav <rahul.r.yadav at oracle.com> wrote:
>>
>> Hello,
>>
>> Request to have my fix reviewed for issue:
>>
>> JDK-8245245  :  WebSocket can loose the URL encoding of URI query parameters
>>
>> The fix updates the jdk.internal.net.http.websocket.OpeningHandshake
>> to ensure that the URL is not reencoded/decoded and loose the original
>> encoding
>>
>> Issue:  https://bugs.openjdk.java.net/browse/JDK-8245245
>> webrev: http://cr.openjdk.java.net/~ryadav/webrev_8245245/index.html
>>
>> - rahul

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20200626/68ea899e/attachment.htm>


More information about the net-dev mailing list