Skip to content

http2: validate non-link headers in writeEarlyHints - #62017

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:http-early-hints-validate-headers
May 15, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mcollina:http-early-hints-validate-headers

Conversation

@mcollina

@mcollina mcollina commented Feb 27, 2026 •

Copy link
Copy Markdown
Member

Summary

The HTTP/1.1 portion of the original PR landed separately in #61897. This PR now contains only the HTTP/2 compat layer counterpart.

  • Validate header names and values for non-link hints in Http2ServerResponse.prototype.writeEarlyHints() using assertValidHeader() and checkIsHttpToken()
  • Throws a clear error at the call site instead of forwarding invalid header names/values deeper into the HTTP/2 stack

Test plan

  • test/parallel/test-http2-compat-write-early-hints-invalid-header.js — verifies ERR_INVALID_HTTP_TOKEN for bad header names and ERR_HTTP2_INVALID_HEADER_VALUE for bad values
  • Existing early hints tests still pass

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http Issues and PRs related to the http subsystem. http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants