From 7480713af5c85689e3e5e0fe4fc46d8f6056d6d0 Mon Sep 17 00:00:00 2001 From: Daniel Watford Date: Mon, 3 Oct 2022 13:37:05 +0100 Subject: [PATCH] feat(start): set host header in proxied requests to match remote API hosts Changes the host header from localhost to the remote API host, permitting a host match to be found against the remote host's certificate. --- src/msha/handlers/function.handler.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/msha/handlers/function.handler.ts b/src/msha/handlers/function.handler.ts index 66bc6158..668a1bf2 100644 --- a/src/msha/handlers/function.handler.ts +++ b/src/msha/handlers/function.handler.ts @@ -70,6 +70,8 @@ export function handleFunctionRequest(req: http.IncomingMessage, res: http.Serve res, { target, + // Set the host header to match the remote API host. + changeOrigin: true, }, onConnectionLost(req, res, target, "↳") );