From a29a9c90724f98a5ead29780707a3b4f598baff6 Mon Sep 17 00:00:00 2001 From: MrBBot Date: Sun, 19 Jun 2022 15:15:12 +0100 Subject: [PATCH] Remove header filtering hack, ref #288 Co-authored-by: Cherry --- packages/core/src/standards/http.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/core/src/standards/http.ts b/packages/core/src/standards/http.ts index d4cdbdb03..91166a4bc 100644 --- a/packages/core/src/standards/http.ts +++ b/packages/core/src/standards/http.ts @@ -53,20 +53,6 @@ import { } from "./helpers"; import { kContentLength } from "./streams"; -// `undici` restricts which headers can be added to/gotten from a `Headers` -// object in `Request`/`Response`s. Whilst this restriction makes sense for -// security reasons in the browser, it doesn't server side. -// -// Note: this is a massive hack. I'm fully expecting it to break in future -// `undici` versions and need to be updated, but that's why we pin our `undici` -// version and have tests... :) Right? -const constants: { - readonly forbiddenHeaderNames: string[]; - readonly forbiddenResponseHeaderNames: string[]; -} = require("undici/lib/fetch/constants.js"); -constants.forbiddenHeaderNames.length = 0; -constants.forbiddenResponseHeaderNames.length = 0; - // We need these for making Request's Headers immutable const fetchSymbols: { readonly kState: unique symbol;