Added test cases with missing alerts for Request and NextRequest.

This commit is contained in:
Napalys
2025-03-31 13:50:56 +02:00
parent eac14b9837
commit 81cba7fa2f
3 changed files with 26 additions and 0 deletions

View File

@@ -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 });
}

View File

@@ -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 });
}

View File

@@ -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"
}
}