How to embed a colon in the fragment part of URL without it being encoded?

204 views Asked by At

I am trying to construct the below URL:

https://console.aws.amazon.com/elasticmapreduce/home?region=us-east-1#cluster-details:j-1IGU6572KT6LB

I am not sure how to include the :j-1IGU6572KT6LB. When I include :`, it gets encoded. Trying to see if that can be avoided.

This is what I have:

    UriBuilder
    .fromPath("console.aws.amazon.com")
    .path("elasticmapreduce")
    .path("home")
    .queryParam("region","us-east-1")
    .fragment("cluster-details")
    .port(-1)
    .scheme("https")
1

There are 1 answers

0
Julian Reschke On

If the ":" in fragments is encoded that appears to me to be a bug (see RFC 3986, Section 3.5 and 3.3). I recommend to open a bug report.

OTOH, if a recipient fails to handle the percent-encoded colon, that's a bug as well.