Skip to content

Commit 41b3908

Browse files
committed
since only one blacklist for now make it faster
1 parent 0a3778d commit 41b3908

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/http-proxy/common.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface Outgoing extends Outgoing0 {
2323
// We strip this header if it appears in any request, and then things
2424
// work fine.
2525
// See https://github.com/http-party/node-http-proxy/issues/1647
26-
const HEADER_BLACKLIST = new Set(["trailer"]);
26+
const HEADER_BLACKLIST = "trailer";
2727

2828
// setupOutgoing -- Copies the right headers from `options` and `req` to
2929
// `outgoing` which is then used to fire the proxied request by calling
@@ -70,8 +70,9 @@ export function setupOutgoing(
7070
// outgoing.headers['Trailer'] won't work, because
7171
// it might be {'TrAiLeR':...}
7272
for (const header in outgoing.headers) {
73-
if (HEADER_BLACKLIST.has(header.toLowerCase())) {
73+
if (HEADER_BLACKLIST == header.toLowerCase()) {
7474
delete outgoing.headers[header];
75+
break;
7576
}
7677
}
7778

0 commit comments

Comments
 (0)