Skip to content

Commit

Permalink
fix: guard to immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Nov 9, 2023
1 parent 231c50f commit 0c9c7dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fetch/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class Headers {
name = webidl.converters.ByteString(name)

// Note: Allow pseudo-header for H2. e.g. `:status`
if (this[kGuard] === 'response') {
if (this[kGuard] === 'immutable') {
if (name.length !== 0 && name.charCodeAt(0) === 58) {
// 1. If name is not a header name, then throw a TypeError.
if (!isValidHeaderName(name.substring(1))) {
Expand Down Expand Up @@ -411,7 +411,7 @@ class Headers {
name = webidl.converters.ByteString(name)

// Note: Allow pseudo-header for H2. e.g. `:status`
if (this[kGuard] === 'response') {
if (this[kGuard] === 'immutable') {
if (name.length !== 0 && name.charCodeAt(0) === 58) {
// 1. If name is not a header name, then throw a TypeError.
if (!isValidHeaderName(name.substring(1))) {
Expand Down

0 comments on commit 0c9c7dd

Please sign in to comment.