Incorrect params parsing?
See original GitHub issueWith a route like the following, I expect the last :y
parameter to not include .mvt
but it’s currently reading :y.mvt
as my param key and including the string .mvt
in the param value.
polka()
.get('/:z/:x/:y.mvt', async (req, res) => {
const { params } = req;
console.log(params.y) // undefined
console.log(params['y.mvt'] // 'myY.mvt'
// workaround
const y = params['y.mvt'].replace('.mvt', '');
console.log(y) // 'myY'
I’m porting an app over from express that parsed this format as expected. But maybe this URL structure is no good to begin with!
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
[@polka/url] Incorrect query params parsing when ... - GitHub
This line decode the url too early causing the encoded & to turn into a param separator. 1
Read more >Incorrect parsing when using @param ...$var - Drupal
Is getting parsed as type string ... and var $var , rather than string and var ...$var . This results in an errors...
Read more >Incorrect parsing for connection parameters - CUBA.Platform
Hi Team, The Data Store Porperties editor of Studio can't parse connection parameter containing '/' correctly . Fox example, cuba.
Read more >URL parameters parsed incorrectly using HTTP/2 connector
I'm using Tomcat 8.5.9. It appears that query strings containing percent encoded ampersand (%26) and percent (%25) characters are not parsed ...
Read more >Multiple 'path' parameters in flask route lead to incorrect parsing
First it may unquote it and later it has problem to detect ends of paths. You should use char which you will not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks.
I have a solution here which allows for parsing/matching against any extension-like parameters. This will also apply route filtering.
I’ve not (yet?) published this because it drops 100k to 400k ops/sec in each of the benchmarks. I’ll sit on it & see if a better way comes to mind.
Ah thanks! It was a fun one to work on. Very cool. Thanks for continuing to commit the brain cells to this one.