WMTS Imagery Provider with subdomains drops query parameters

I’m trying to use the subdomains feature provided by UrlTemplateImageryProvider (and available to WebMapServiceImageryProvider and WebMapTileServiceImageryProvider constructors), but I’m seeing that by simply adding the {s} template variable to an WMTS URL, all tile requests issued by WebMapTileServiceImageryProvider, while the subdomain substitutions appear to work, are dropping all query parameters, which are obviously critical.

If I just remove the {s} template variable from the URL, all query parameters are attached to the tile requests. I’ve used the same subdomains feature on WebMapServiceImageryProvider and it’s behaving as expected.

This is a Sandcastle example showing the problem. Ignore the fact that the tile requests will still fail with 401—just see the actual request URLs being sent in the browser debugger.

@Erhhung_Yuan thanks for bringing this to our attention - this looks like a bug on our end. I’ve opened an
issue on GitHub to track this.