Cascading WMTS wrongly %-encodes a colon in the URL

When configuring a cascading WMTS Geoserver generates the following URL:

https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/2025_orthoHR/EPSG%3A3857/04/6/6.jpeg

This is met by a server exception. The server does accept:

https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/2025_orthoHR/EPSG:3857/04/6/6.jpeg

In this URL, the colon after EPSG is not %-encoded, the rest is the same.

Although standards are not very clear in this case, but based on RFC 3986: Uniform Resource Identifier (URI): Generic Syntax | RFC Editor , and the useful discussion in this thread https://stackoverflow.com/a/2053640 I reach the conclusion that the colon after EPSG should NOT be %-encoded.

Is there any way that I can prevent this %-encoding?

Regards, MArco

I think that it is OK to use colon in that place, but by the standard it is not wrong to use %-encoding either. Servers should accept both versions similarly. Obviously that is not the case. I agree that for best interoperability GeoServer should not url-encode colon.

Agree, it’s not wrong according to RFC 3986, it’s just unecessary.

Any RFC 3986-compliant client/server will decode and treat them identically.

But… a naively written system might not perform the decoding, e.g., a proxy could be matching the string literally and don’t perform the percent decoding.

Not a bug on the GeoServer side, but GeoServer could avoid the percent encoding for sure.
I’m guessing the code change ought to be made down in GeoTools, in the WMTS client.
Marco if you want the improvement to happen, please read this guide:

Cheers
Andrea