mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Added test cases with missing alerts for Request and NextRequest.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
export async function POST(req: Request) {
|
||||
const { url } = await req.json(); // $ MISSING: Source[js/request-forgery]
|
||||
const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery]
|
||||
return new Response(res.body, { headers: res.headers });
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const { url } = await req.json(); // $ MISSING: Source[js/request-forgery]
|
||||
const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery]
|
||||
const data = await res.text();
|
||||
return new NextResponse(data, { headers: res.headers });
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "next-edge-proxy-app",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "15.1.7"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user