-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
http2: correct behaviour for enablePush unpack #15167
Conversation
I'm +1 on that, let's make the right choice while we still can rather than encourage bad code. |
The failures don't look related to this, or am I missing something? Can we run the CI again maybe? |
Oy, all red, but seemingly unrelated... hmmm. trying again https://ci.nodejs.org/job/node-test-commit/12221/ |
CI is failing on this. |
The only valid values for enablePush are 0 and 1. If validation is requested, we should verify that it wasn't set to another value rather than casting to Boolean regardless of value.
@jasnell as it should be. Yikes. Sorry about that. Fixed now. |
4067da0
to
f4ee377
Compare
Bah. Looks like the session timeout test is still flaky occasionally. Will need to look into it. But not related to this PR. |
Landed in c20901a |
The only valid values for enablePush are 0 and 1. If validation is requested, we should verify that it wasn't set to another value rather than casting to Boolean regardless of value. PR-URL: #15167 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Thanks for landing all those PRs, @BridgeAR! Thanks for the reviews everyone. |
The only valid values for enablePush are 0 and 1. If validation is requested, we should verify that it wasn't set to another value rather than casting to Boolean regardless of value. PR-URL: nodejs#15167 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
The only valid values for enablePush are 0 and 1. If validation is requested, we should verify that it wasn't set to another value rather than casting to Boolean regardless of value. PR-URL: #15167 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
So, as per the spec, the only valid values for
enablePush
should be 0 or 1. nghttp2 already handles this correctly but the JS unpacker exposed to the end-user doesn't. That said, I'm not sure as to the desired behaviour:Set value to the actual value, validate it's within range (if validation requested) and finally set to Boolean (even if it's not 0 or 1, as long as they didn't request validation which would throw).
Set value to the actual value, validate it's within range (if validation requested) and only set to Boolean if it's 0 or 1, otherwise leave as the actual value for the end-user to handle.
I think we should follow the spec here, at least to the extent that we shouldn't just cast everything to Boolean when validating. If validation is requested then it clearly needs to throw if it's not 0 or 1 (it wasn't doing this before).
But not sure what we actually want to output to the end-user if it's not 0 or 1 and no validation was requested.
And here's the spec btw:
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http2, test