Skip to content

NavigationPreloadManager.setHeaderValue should reject invalid header values#1827

Merged
yoshisatoyanagisawa merged 1 commit into
w3c:mainfrom
yoshisatoyanagisawa:setHeaderValue
Jun 17, 2026
Merged

NavigationPreloadManager.setHeaderValue should reject invalid header values#1827
yoshisatoyanagisawa merged 1 commit into
w3c:mainfrom
yoshisatoyanagisawa:setHeaderValue

Conversation

@yoshisatoyanagisawa

@yoshisatoyanagisawa yoshisatoyanagisawa commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This update adds validation for the header value in NavigationPreloadManager.setHeaderValue() to match the Fetch specification's "header value" definition. It now:

  1. Normalizes the input value (stripping HTTP whitespace).
  2. Rejects the promise with a TypeError if the value contains invalid bytes (including \r, \n, or \0).

Fixes #1000


Preview | Diff

…values

This update adds validation for the header value in
NavigationPreloadManager.setHeaderValue() to match the Fetch
specification's "header value" definition. It now:
1. Normalizes the input value (stripping HTTP whitespace).
2. Rejects the promise with a TypeError if the value contains
   invalid bytes (including \r, \n, or \0).

Fixes w3c#1000
@yoshisatoyanagisawa

Copy link
Copy Markdown
Collaborator Author

@monica-ch Will you review this?

@yoshisatoyanagisawa yoshisatoyanagisawa merged commit 1044d87 into w3c:main Jun 17, 2026
2 checks passed
@yoshisatoyanagisawa yoshisatoyanagisawa deleted the setHeaderValue branch June 17, 2026 06:47
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
…values (#1827)

SHA: 1044d87
Reason: push, by yoshisatoyanagisawa

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@annevk

annevk commented Jun 17, 2026

Copy link
Copy Markdown
Member

Do we have tests for this as well?

github-actions Bot added a commit to asleekgeek/ServiceWorker that referenced this pull request Jun 17, 2026
…values (w3c#1827)

SHA: 1044d87
Reason: push, by pull[bot]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationPreloadManager.setHeaderValue should reject invalid HTTP header field values

3 participants