{{ message }}
http2: correct behaviour for enablePush unpack#15167
Closed
apapirovski wants to merge 1 commit into
Closed
Conversation
addaleax
approved these changes
Sep 3, 2017
Member
benjamingr
approved these changes
Sep 3, 2017
lpinca
approved these changes
Sep 4, 2017
jasnell
approved these changes
Sep 5, 2017
Member
Contributor
Author
|
The failures don't look related to this, or am I missing something? Can we run the CI again maybe? |
Member
|
Oy, all red, but seemingly unrelated... hmmm. trying again https://ci.nodejs.org/job/node-test-commit/12221/ |
Member
|
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.
Contributor
Author
|
@jasnell as it should be. Yikes. Sorry about that. Fixed now. |
4067da0 to
f4ee377
Compare
BridgeAR
approved these changes
Sep 8, 2017
Member
Contributor
Author
|
Bah. Looks like the session timeout test is still flaky occasionally. Will need to look into it. But not related to this PR. |
Member
|
Landed in c20901a |
BridgeAR
pushed a commit
that referenced
this pull request
Sep 11, 2017
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 <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Contributor
Author
addaleax
pushed a commit
to addaleax/node
that referenced
this pull request
Sep 13, 2017
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 <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
jasnell
pushed a commit
that referenced
this pull request
Sep 20, 2017
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 <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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.

So, as per the spec, the only valid values for
enablePushshould 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