From 133a0a65398515f28a38b2c65da94ce6fc34fede Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 15 Mar 2025 07:31:15 -0700 Subject: [PATCH] Fix this --- src/middleware.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/middleware.js b/src/middleware.js index a2b24f4a..bb9fbea5 100644 --- a/src/middleware.js +++ b/src/middleware.js @@ -4,6 +4,7 @@ export function middleware(req) { // Check the Host header, if HOMEPAGE_ALLOWED_HOSTS is set const host = req.headers.get("host"); const port = process.env.PORT || 3000; + let allowedHosts = [`localhost:${port}`, `127.0.0.1:${port}`]; const allowAll = process.env.HOMEPAGE_ALLOWED_HOSTS === "*"; if (process.env.HOMEPAGE_ALLOWED_HOSTS) { allowedHosts = allowedHosts.concat(process.env.HOMEPAGE_ALLOWED_HOSTS.split(","));