From e5bef44a20b63942699432be208747951133c607 Mon Sep 17 00:00:00 2001 From: jveay <782303307@qq.com> Date: Wed, 10 Jul 2024 16:22:50 +0800 Subject: [PATCH] fix(runtime): Fix static web hosting failure on non-standard ports --- runtimes/nodejs/src/storage-server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtimes/nodejs/src/storage-server.ts b/runtimes/nodejs/src/storage-server.ts index 6d764a2b16..eea94ddf0c 100644 --- a/runtimes/nodejs/src/storage-server.ts +++ b/runtimes/nodejs/src/storage-server.ts @@ -62,9 +62,9 @@ const storageServer = http.createServer( try { const proxyReqUrl = new URL(Config.OSS_INTERNAL_ENDPOINT) - + const reqHost = new URL(`${req.headers['x-forwarded-proto']}://${req.headers.host}`) const path = await websiteHostingPathHandler( - req.headers.host || '', + reqHost.hostname || '', req.url || '', )