fix port
Some checks failed
Docker / Linting Checks (push) Has been cancelled
Docker / Docker Build & Push (push) Has been cancelled

This commit is contained in:
shamoon
2025-02-04 21:16:57 -08:00
parent 075a3d4da6
commit abe1e9be5d

View File

@@ -3,7 +3,8 @@ import { NextResponse } from "next/server";
export function middleware(req) {
// Check the Host header, if HOMEPAGE_ALLOWED_HOSTS is set
const host = req.headers.get("host");
let allowedHosts = ["localhost:3000"];
const port = process.env.PORT || 3000;
let allowedHosts = [`localhost:${port}`];
if (process.env.HOMEPAGE_ALLOWED_HOSTS) {
allowedHosts = allowedHosts.concat(process.env.HOMEPAGE_ALLOWED_HOSTS.split(","));
}