Refactor: Use URLSearchParams instead of L.Util.template for query #838
Open
tbsmark86 wants to merge 1 commit intonrenner:masterfrom
Open
Refactor: Use URLSearchParams instead of L.Util.template for query #838tbsmark86 wants to merge 1 commit intonrenner:masterfrom
tbsmark86 wants to merge 1 commit intonrenner:masterfrom
Conversation
…ilding L.Util.template was missing url-escaping, while the values should never contain anything that needs escaping better safe then sorry.
Contributor
|
Here is double-escaping going on, which has to be fixed before merging. The call to 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');
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.