Skip to content

Conversation

@tbsmark86
Copy link
Contributor

L.Util.template was missing url-escaping, while the values should never contain anything that needs escaping better safe then sorry.


Just a random bit I've stumbled over while trying to understand the code for something else.

…ilding

L.Util.template was missing url-escaping, while the values should never
contain anything that needs escaping better safe then sorry.
@mjaschen
Copy link
Contributor

mjaschen commented Aug 14, 2025

Here is double-escaping going on, which has to be fixed before merging. The call to encodeURIComponent() in

https://github.com/nrenner/brouter-web/blob/master/js/router/BRouter.js#L346

has to be removed.

Possible test case:

test('handles POI names with special characters', () => {
            const latLngs = [L.latLng(49.488117, 8.467712)];
            const pois = [{ latlng: L.latLng(49.4882, 8.4678), name: 'Café & Restaurant' }];

            const url = router.getUrl(latLngs, null, pois);

            expect(url).toContain('pois=8.4678%2C49.4882%2CCaf%C3%A9+%26+Restaurant');
        });

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.

2 participants