From e5ab3d5f8edf81d9950cd570c9c881cc4b27a94f Mon Sep 17 00:00:00 2001 From: tsctx <91457664+tsctx@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:47:49 +0900 Subject: [PATCH] feat: check pseudo-header --- lib/fetch/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) } }