mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Added middleware test
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export async function middleware(req: NextRequest) {
|
||||
const target = req.nextUrl // $ MISSING : Source[js/request-forgery]
|
||||
if (target) {
|
||||
const res = await fetch(target) // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery]
|
||||
const data = await res.text()
|
||||
return new NextResponse(data)
|
||||
}
|
||||
return NextResponse.next()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user