-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking change with query string validation from 8.6.0 to 9.0.2 #2718
Comments
This seems to be the reason for the breakage: |
This comes from an improperly documented change in qs. @nlf can you help figure out what's the best way to handle this? |
@nlf may be slow in responding to this thread as he is currently back woods camping |
There is an option in qs to disable this behavior. Perhaps hapi could expose this or disable it? |
You can already pass options to qs for both payload and query string processing. |
Yeah, dots should've been disabled by default, this one is my fault. For right now you can pass |
We're stuck with this now. I've updated the release notes to reflect this change. |
How is this being exposed in 13.5.0? |
I found the information I needed from the migration docs: const Url = require('url');
const Qs = require('qs');
const onRequest = function (request, reply) {
const uri = request.raw.req.url;
const parsed = Url.parse(uri, false);
parsed.query = Qs.parse(parsed.query);
request.setUrl(parsed);
return reply.continue();
};
server.ext('onRequest', onRequest); |
I'm receiving a validation failure for requests that worked before upgrading from 8.6.0 to 9.0.2.
The validation that previously worked for query strings of the form
?sensor.battery.eq=4.02
:This is no longer valid after the upgrade. I get the error:
in 8.6.0 --
request.query
was:In 9.0.2 --
request.query
now looks like:The text was updated successfully, but these errors were encountered: