adds stripHeaders to global mutators in createQueuedProxyMiddleware

This commit is contained in:
nai-degen 2024-10-09 16:59:12 -05:00
parent 536803853a
commit b57627e69b
1 changed files with 5 additions and 2 deletions

View File

@ -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;