Skip to content

Commit

Permalink
Update middleware.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon authored Jan 27, 2025
1 parent 61609d6 commit 740d778
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NextResponse } from "next/server";
export function middleware(req) {
// Ensure the request is coming from localhost
const host = req.headers.get("host");
if (!host || host.indexOf("localhost") !== 0) {
if (!host || host.indexOf("localhost:") !== 0) {
return new NextResponse("Invalid Host header", { status: 400 });
}
return NextResponse.next();
Expand Down

0 comments on commit 740d778

Please sign in to comment.