From 1acd21314fe4cfdb6ee7a2e1b933f15842ba2517 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Tue, 4 Oct 2022 07:18:41 -0400 Subject: [PATCH 1/2] [chore] remove unnecessary Request pseudo-header removal --- packages/kit/src/exports/node/index.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/kit/src/exports/node/index.js b/packages/kit/src/exports/node/index.js index 67b82e63f537..9b209bd49064 100644 --- a/packages/kit/src/exports/node/index.js +++ b/packages/kit/src/exports/node/index.js @@ -94,21 +94,9 @@ function get_raw_body(req, body_size_limit) { /** @type {import('@sveltejs/kit/node').getRequest} */ export async function getRequest({ request, base, bodySizeLimit }) { - let headers = /** @type {Record} */ (request.headers); - if (request.httpVersionMajor === 2) { - // we need to strip out the HTTP/2 pseudo-headers because node-fetch's - // Request implementation doesn't like them - // TODO is this still true with Node 18 - headers = Object.assign({}, headers); - delete headers[':method']; - delete headers[':path']; - delete headers[':authority']; - delete headers[':scheme']; - } - return new Request(base + request.url, { method: request.method, - headers, + headers: /** @type {Record} */ (request.headers), body: get_raw_body(request, bodySizeLimit) }); } From 3c398de43c79932350f1b373c81fc9913c530b86 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Tue, 4 Oct 2022 07:20:31 -0400 Subject: [PATCH 2/2] add changeset --- .changeset/early-kiwis-raise.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/early-kiwis-raise.md diff --git a/.changeset/early-kiwis-raise.md b/.changeset/early-kiwis-raise.md new file mode 100644 index 000000000000..4398057566d5 --- /dev/null +++ b/.changeset/early-kiwis-raise.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +[chore] Skip removing HTTP/2 pseudo-headers, which is no longer necessary with undici