node icon indicating copy to clipboard operation
node copied to clipboard

http2: add lenient flag for RFC-9113

Open metcoder95 opened this issue 6 months ago β€’ 2 comments
trafficstars

Aims to close #56703.

The PR proposes the addition of a new flag (provisionally named strictHttpFieldValidation) to be added while creating an HTTP/2 session (either client or server side).

The flag maps to nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation to disable the trailing white space trimming as per RFC-9113.

The flag is not mapped by default to be backwards compatible.

Looking forward for feedback before actually kick-off addition of documentation.

metcoder95 avatar May 02 '25 09:05 metcoder95

Review requested:

  • [ ] @nodejs/http2
  • [ ] @nodejs/net

nodejs-github-bot avatar May 02 '25 09:05 nodejs-github-bot

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.23%. Comparing base (e61aa0c) to head (2c4db31). Report is 333 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/http2/util.js 88.88% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58116      +/-   ##
==========================================
+ Coverage   89.67%   90.23%   +0.55%     
==========================================
  Files         630      633       +3     
  Lines      186445   186831     +386     
  Branches    36310    36681     +371     
==========================================
+ Hits       167190   168578    +1388     
+ Misses      11998    11038     -960     
+ Partials     7257     7215      -42     
Files with missing lines Coverage Ξ”
src/node_http2.cc 83.36% <100.00%> (-0.02%) :arrow_down:
src/node_http2_state.h 100.00% <ΓΈ> (ΓΈ)
lib/internal/http2/util.js 92.31% <88.88%> (-0.04%) :arrow_down:

... and 162 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar May 02 '25 10:05 codecov[bot]

CI: https://ci.nodejs.org/job/node-test-pull-request/66856/

nodejs-github-bot avatar May 17 '25 09:05 nodejs-github-bot

Not so sure the failures are related to these changes?

metcoder95 avatar May 20 '25 20:05 metcoder95

CI: https://ci.nodejs.org/job/node-test-pull-request/66979/

nodejs-github-bot avatar May 21 '25 12:05 nodejs-github-bot

Ready to land?

metcoder95 avatar May 28 '25 22:05 metcoder95

Commit Queue failed
- Loading data for nodejs/node/pull/58116
βœ”  Done loading data for nodejs/node/pull/58116
----------------------------------- PR info ------------------------------------
Title      http2: add lenient flag for RFC-9113 (#58116)
Author     Carlos Fuentes <[email protected]> (@metcoder95)
Branch     metcoder95:feat/56703 -> nodejs:main
Labels     c++, lib / src, author ready, needs-ci
Commits    7
 - http2: add lenient flag for RFC-9113
 - fix: lint
 - refactor: rename to strictFieldWhitespaceValidation
 - docs: add documentation
 - test: fix lenient flag tests
 - fix: tangling servers
 - fix: lint
Committers 1
 - Carlos Fuentes <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/58116
Reviewed-By: Tim Perry <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/58116
Reviewed-By: Tim Perry <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
--------------------------------------------------------------------------------
   β„Ή  This PR was created on Fri, 02 May 2025 09:18:54 GMT
   βœ”  Approvals: 3
   βœ”  - Tim Perry (@pimterry): https://github.com/nodejs/node/pull/58116#pullrequestreview-2835903299
   βœ”  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/58116#pullrequestreview-2848202531
   βœ”  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/58116#pullrequestreview-2899412337
   βœ”  Last GitHub CI successful
   β„Ή  Last Full PR CI on 2025-05-21T12:04:38Z: https://ci.nodejs.org/job/node-test-pull-request/66979/
- Querying data for job/node-test-pull-request/66979/
   βœ”  Last Jenkins CI successful
--------------------------------------------------------------------------------
   βœ”  No git cherry-pick in progress
   βœ”  No git am in progress
   βœ”  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
βœ”  origin/main is now up-to-date
- Downloading patch for 58116
From https://github.com/nodejs/node
 * branch                  refs/pull/58116/merge -> FETCH_HEAD
βœ”  Fetched commits as 516b4ebd3c62..2c4db31e3566
--------------------------------------------------------------------------------
Auto-merging src/node_http2.cc
[main 725012f6d3] http2: add lenient flag for RFC-9113
 Author: Carlos Fuentes <[email protected]>
 Date: Fri May 2 11:14:06 2025 +0200
 6 files changed, 179 insertions(+), 2 deletions(-)
 create mode 100644 test/parallel/test-http2-server-rfc-9113-client.js
 create mode 100644 test/parallel/test-http2-server-rfc-9113-server.js
Auto-merging src/node_http2.cc
[main 299fdf1af5] fix: lint
 Author: Carlos Fuentes <[email protected]>
 Date: Sun May 11 11:57:45 2025 +0200
 3 files changed, 13 insertions(+), 18 deletions(-)
Auto-merging src/node_http2.cc
[main 1f34eb21f8] refactor: rename to strictFieldWhitespaceValidation
 Author: Carlos Fuentes <[email protected]>
 Date: Sun May 11 12:03:57 2025 +0200
 5 files changed, 11 insertions(+), 11 deletions(-)
Auto-merging doc/api/http2.md
[main ea88471716] docs: add documentation
 Author: Carlos Fuentes <[email protected]>
 Date: Sun May 11 12:11:51 2025 +0200
 1 file changed, 12 insertions(+)
[main 1f8aed124f] test: fix lenient flag tests
 Author: Carlos Fuentes <[email protected]>
 Date: Thu May 15 19:07:45 2025 +0200
 1 file changed, 4 insertions(+), 4 deletions(-)
[main 9a4f475fa8] fix: tangling servers
 Author: Carlos Fuentes <[email protected]>
 Date: Thu May 15 20:52:50 2025 +0200
 2 files changed, 12 insertions(+), 2 deletions(-)
[main cabf7bac01] fix: lint
 Author: Carlos Fuentes <[email protected]>
 Date: Thu May 15 20:57:06 2025 +0200
 1 file changed, 1 insertion(+), 1 deletion(-)
   βœ”  Patches applied
There are 7 commits in the PR. Attempting autorebase.
Rebasing (2/14)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
http2: add lenient flag for RFC-9113

PR-URL: https://github.com/nodejs/node/pull/58116 Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD e7badb22b4] http2: add lenient flag for RFC-9113 Author: Carlos Fuentes <[email protected]> Date: Fri May 2 11:14:06 2025 +0200 6 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-http2-server-rfc-9113-client.js create mode 100644 test/parallel/test-http2-server-rfc-9113-server.js Rebasing (3/14) Rebasing (4/14) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- fix: lint

PR-URL: https://github.com/nodejs/node/pull/58116 Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD 63b3343312] fix: lint Author: Carlos Fuentes <[email protected]> Date: Sun May 11 11:57:45 2025 +0200 3 files changed, 13 insertions(+), 18 deletions(-) Rebasing (5/14) Rebasing (6/14) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- refactor: rename to strictFieldWhitespaceValidation

PR-URL: https://github.com/nodejs/node/pull/58116 Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD fa7e52b7f5] refactor: rename to strictFieldWhitespaceValidation Author: Carlos Fuentes <[email protected]> Date: Sun May 11 12:03:57 2025 +0200 5 files changed, 11 insertions(+), 11 deletions(-) Rebasing (7/14) Rebasing (8/14) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- docs: add documentation

PR-URL: https://github.com/nodejs/node/pull/58116 Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD 60c137da56] docs: add documentation Author: Carlos Fuentes <[email protected]> Date: Sun May 11 12:11:51 2025 +0200 1 file changed, 12 insertions(+) Rebasing (9/14) Rebasing (10/14) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- test: fix lenient flag tests

PR-URL: https://github.com/nodejs/node/pull/58116 Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD 161bef1ea1] test: fix lenient flag tests Author: Carlos Fuentes <[email protected]> Date: Thu May 15 19:07:45 2025 +0200 1 file changed, 4 insertions(+), 4 deletions(-) Rebasing (11/14) Rebasing (12/14) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- fix: tangling servers

PR-URL: https://github.com/nodejs/node/pull/58116 Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD 9434f4d2a0] fix: tangling servers Author: Carlos Fuentes <[email protected]> Date: Thu May 15 20:52:50 2025 +0200 2 files changed, 12 insertions(+), 2 deletions(-) Rebasing (13/14) Rebasing (14/14) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- fix: lint

PR-URL: https://github.com/nodejs/node/pull/58116 Reviewed-By: Tim Perry <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>

[detached HEAD b022077160] fix: lint Author: Carlos Fuentes <[email protected]> Date: Thu May 15 20:57:06 2025 +0200 1 file changed, 1 insertion(+), 1 deletion(-) Successfully rebased and updated refs/heads/main.

β„Ή Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/15462757875

nodejs-github-bot avatar Jun 05 '25 08:06 nodejs-github-bot

Landed in 02a1505efcf7099498240e83327f7c0d71696f47

nodejs-github-bot avatar Jun 05 '25 12:06 nodejs-github-bot