I am running into a problem with this Chrome issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=943026
The thing is that Chrome encodes the pipe character | and Firefox doesn't. So a URL like:
# route: app.get('route/:myParam', ...)
GET https://server.asdf/route/asdf|123456
goes through unencoded (as it should) on Firefox and on Chrome it arrives encoded, breaking the request since myParam has a different value on both browsers.
Now it seems to me that Polka does not decode params coming via the URL itself, only through the query.
My question: Should I add middleware for this myself or is this something that you would include in Polka?
Hi there, what version of Polka are you using?
Hey, thanks for the quick response! I'm using v0.5.2
Ah, then yes. In @next decoding is automatic, and does the whole URL.
If you just want to upgrade a piece of your app, you can by upgrading the parse method to use @polka/url@next
const parser = require('@polka/url');
const polka = require('polka');
const main = polka() // ...;
main.parse = (req) => parser(req, true);
main.listen(...)
Hope that helps!
Great, that's exactly what I need! Thank you!