mirror of
https://github.com/LittleChest/Dohna-NS.git
synced 2026-05-06 22:44:50 +08:00
common: Block requests with unusual Host header
This commit is contained in:
parent
e8c40e9d7c
commit
1a10e16745
@ -7,6 +7,13 @@ export default async function handler(
|
||||
rawIP,
|
||||
) {
|
||||
const { method, headers, url } = request;
|
||||
|
||||
const host = headers.get("Host");
|
||||
|
||||
if (host && (host.endsWith(":443") || host.endsWith(":80"))) {
|
||||
return new Response(null, { status: 403 });
|
||||
}
|
||||
|
||||
const { search, searchParams, pathname } = new URL(url);
|
||||
|
||||
const ip =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user