Compare commits

..
Author SHA1 Message Date
shamoon 5f6059896b Try bind all addresses 2025-01-27 10:26:04 -08:00
shamoon b906b64fcd or this 2025-01-27 09:54:59 -08:00
shamoon cdcf9bc4a4 Try this 2025-01-27 09:21:16 -08:00
shamoon e2bf0e4975 Update next.config.js 2025-01-27 07:36:14 -08:00
shamoon 9179bc07c7 Update next.config.js 2025-01-27 07:31:58 -08:00
-18
View File
@@ -1,18 +0,0 @@
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");
const allowedHosts = process.env.HOMEPAGE_ALLOWED_HOSTS
? process.env.HOMEPAGE_ALLOWED_HOSTS.split(",").concat(["localhost:3000"])
: [];
console.log("Host: ", host, "Allowed Hosts: ", allowedHosts);
if (allowedHosts.length && !(host || allowedHosts.includes(host))) {
return new NextResponse("Invalid Host header", { status: 400 });
}
return NextResponse.next();
}
export const config = {
matcher: "/api/:path*",
};