Skip to content

Commit

Permalink
chore: update example
Browse files Browse the repository at this point in the history
  • Loading branch information
aiji42 committed May 2, 2022
1 parent 9fa3b21 commit a0ef154
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion example/src/pages/ip/_middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export const middleware: NextMiddleware = (req, event) => {
const ips = req.cookies['__allowed_ips']
if (!ips) {
if (req.preflight) return new NextResponse(null)
return NextResponse.redirect('/ip')
const url = req.nextUrl.clone()
url.pathname = '/ip'
return NextResponse.redirect(url)
}

return makeIPInspector(ips.split(','), {
Expand Down

0 comments on commit a0ef154

Please sign in to comment.