Skip to content

Commit

Permalink
Remove header filtering hack, ref cloudflare#288
Browse files Browse the repository at this point in the history
Co-authored-by: Cherry <james@jross.me>
  • Loading branch information
mrbbot and Cherry committed Jun 19, 2022
1 parent 7feda02 commit a29a9c9
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/core/src/standards/http.ts
Expand Up @@ -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;
Expand Down

0 comments on commit a29a9c9

Please sign in to comment.