diff --git a/lib/fetch/index.js b/lib/fetch/index.js index 298b3ddb27c..cc01f145b48 100644 --- a/lib/fetch/index.js +++ b/lib/fetch/index.js @@ -2002,7 +2002,8 @@ async function httpNetworkFetch ( location = val } - headers.append(key, val) + // Note: Not allow pseudo-header for H2. e.g. `:status` + if (key.charCodeAt(0) !== 58) headers.append(key, val) } } else { const keys = Object.keys(headersList) @@ -2016,7 +2017,8 @@ async function httpNetworkFetch ( location = val } - headers.append(key, val) + // Note: Not allow pseudo-header for H2. e.g. `:status` + if (key.charCodeAt(0) !== 58) headers.append(key, val) } }