Skip to content

http2: add lenient flag for RFC-9113 #58116

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

metcoder95
Copy link
Member

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.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 2, 2025
Copy link

codecov bot commented May 2, 2025

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 160 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/http2/util.js 88.88% 1 Missing ⚠️
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%) ⬇️
src/node_http2_state.h 100.00% <ø> (ø)
lib/internal/http2/util.js 92.31% <88.88%> (-0.04%) ⬇️

... and 162 files with indirect coverage changes

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

Copy link
Member

@pimterry pimterry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter and the tests themselves are failing here.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@metcoder95 metcoder95 requested a review from pimterry May 11, 2025 10:13
Copy link
Member

@pimterry pimterry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, thanks for updating that 👍. Options buffer test is still failing though.

@@ -25,7 +25,8 @@ const IDX_OPTIONS_MAX_SESSION_MEMORY = 8;
const IDX_OPTIONS_MAX_SETTINGS = 9;
const IDX_OPTIONS_STREAM_RESET_RATE = 10;
const IDX_OPTIONS_STREAM_RESET_BURST = 11;
const IDX_OPTIONS_FLAGS = 12;
const IDX_OPTIONS_STRICT_HTTP_HEADER_FIELD_VALIDATION = 12;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this still has the old option name (just test code, but nice to be consistent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http2 client drops response headers if the value ends with a space
4 participants