From b57627e69b0de96a94d5137e675db0112edffe9a Mon Sep 17 00:00:00 2001 From: nai-degen Date: Wed, 9 Oct 2024 16:59:12 -0500 Subject: [PATCH] adds stripHeaders to global mutators in createQueuedProxyMiddleware --- src/proxy/middleware/request/proxy-middleware-factory.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/proxy/middleware/request/proxy-middleware-factory.ts b/src/proxy/middleware/request/proxy-middleware-factory.ts index 07bce4f..5de2778 100644 --- a/src/proxy/middleware/request/proxy-middleware-factory.ts +++ b/src/proxy/middleware/request/proxy-middleware-factory.ts @@ -8,7 +8,7 @@ import { debugProxyErrorsPlugin, proxyEventsPlugin, } from "http-proxy-middleware"; -import { ProxyReqMutator } from "./index"; +import { ProxyReqMutator, stripHeaders } from "./index"; import { createOnProxyResHandler, ProxyResHandlerWithBody } from "../response"; import { createQueueMiddleware } from "../../queue"; import { getHttpAgents } from "../../../shared/network"; @@ -94,7 +94,10 @@ export function createQueuedProxyMiddleware({ }) as any, }); - return createQueueMiddleware({ mutations, proxyMiddleware }); + return createQueueMiddleware({ + mutations: [stripHeaders, ...(mutations ?? [])], + proxyMiddleware, + }); } type ProxiedResponse = http.IncomingMessage & Response & any;