Skip to content
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

http2: check for valid headers #33193

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/internal/http2/core.js
Expand Up @@ -1627,11 +1627,11 @@ class ClientHttp2Session extends Http2Session {

this[kUpdateTimer]();

for (const i in headers) {
if (i[0] === ':') {
assertValidPseudoHeader(i);
} else if (i && !checkIsHttpToken(i))
this.destroy(new ERR_INVALID_HTTP_TOKEN('Header name', i));
for (const header of Object.keys(headers)) {
rexagod marked this conversation as resolved.
Show resolved Hide resolved
if (header[0] === ':') {
assertValidPseudoHeader(header);
} else if (header && !checkIsHttpToken(header))
this.destroy(new ERR_INVALID_HTTP_TOKEN('Header name', header));
}
rexagod marked this conversation as resolved.
Show resolved Hide resolved

assertIsObject(headers, 'headers');
Expand Down