Update middleware.js
This commit is contained in:
parent
ee7be33fa1
commit
eeda1563fd
@ -6,6 +6,7 @@ export function middleware(req) {
|
|||||||
const allowedHosts = process.env.HOMEPAGE_ALLOWED_HOSTS
|
const allowedHosts = process.env.HOMEPAGE_ALLOWED_HOSTS
|
||||||
? process.env.HOMEPAGE_ALLOWED_HOSTS.split(",").concat(["localhost:3000"])
|
? process.env.HOMEPAGE_ALLOWED_HOSTS.split(",").concat(["localhost:3000"])
|
||||||
: [];
|
: [];
|
||||||
|
console.log("Host: ", host, "Allowed Hosts: ", allowedHosts);
|
||||||
if (allowedHosts.length && !(host || allowedHosts.includes(host))) {
|
if (allowedHosts.length && !(host || allowedHosts.includes(host))) {
|
||||||
return new NextResponse("Invalid Host header", { status: 400 });
|
return new NextResponse("Invalid Host header", { status: 400 });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user