Skip to content

Conversation

@kring
Copy link
Member

@kring kring commented Jan 28, 2025

This is a PR into #1072.

It bothered me that the URL placeholders (like {z}) in the tile URL templates in layer.json were escaped, and then substituteTemplateParameters had to deal with this potential escaping. So this is an attempt to avoid that in a fairly simple way: substitute the values into the template URL before treating it as a URL.

I think this is fairly reasonable. A URL with placeholders is not a valid URL, so don't try to pretend it is. If this looks reasonable to you @azrogers, then I think the changes to substituteTemplateParameters to allow escaped placeholders can be reverted.

The other places we were using placeholders in URLs (UrlTemplateRasterOverlay and WebMapTileServiceRasterOverlay) were already doing this, perhaps accidentally.

@azrogers azrogers merged commit 9e032f8 into ada-url Jan 28, 2025
22 checks passed
@azrogers azrogers deleted the ada-url-substitute-first branch January 28, 2025 15:14
@azrogers
Copy link
Contributor

Thanks @kring!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants