Skip to content

Commit e5296da

Browse files
committed
Updat testings
1 parent 492de92 commit e5296da

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/bad-url/test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { assertEquals } from "jsr:@std/assert";
2+
3+
const badUrls = [
4+
"http://localhost:8080/wp-admin.php",
5+
"http://localhost:8080/.well-known/appspecific/com.chrome.devtools.json",
6+
"http://localhost:8080/.env",
7+
"http://localhost:8080/[email protected]/../../../../../../../../../../etc/passwd?raw=1&module=1",
8+
];
9+
10+
Deno.test("ban bad urls", async () => {
11+
for (const url of badUrls) {
12+
const res = await fetch(url);
13+
await res.body?.cancel();
14+
assertEquals(res.status, 404);
15+
}
16+
});

0 commit comments

Comments
 (0)