Skip to content

Commit 02d2369

Browse files
committed
Added test cases with missing alerts for Request and NextRequest.
1 parent 01275aa commit 02d2369

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export async function POST(req: Request) {
2+
const { url } = await req.json(); // $ MISSING: Source[js/request-forgery]
3+
const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery]
4+
return new Response(res.body, { headers: res.headers });
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { NextRequest, NextResponse } from 'next/server';
2+
3+
export async function POST(req: NextRequest) {
4+
const { url } = await req.json(); // $ MISSING: Source[js/request-forgery]
5+
const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery]
6+
const data = await res.text();
7+
return new NextResponse(data, { headers: res.headers });
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "next-edge-proxy-app",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start"
9+
},
10+
"dependencies": {
11+
"next": "15.1.7"
12+
}
13+
}

0 commit comments

Comments
 (0)