From 05a6acb27aefa862dff5385fea68d825a1324148 Mon Sep 17 00:00:00 2001 From: LittleChest Date: Tue, 22 Jul 2025 17:23:11 +0800 Subject: [PATCH] common: Update Anti-GFW * Adapt to new changes in GFW --- common.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common.js b/common.js index 0ee3e4d..b0609a6 100644 --- a/common.js +++ b/common.js @@ -9,9 +9,14 @@ export default async function handler( // Anti-GFW if ( - headers.get("user-agent") === "Go-http-client/1.1" && + method === "POST" && pathname === "/dns-query" && - method === "POST" + headers.get("content-type") === "application/dns-message" && + headers.get("accept") === "application/dns-message" && + headers.get("accept-encoding") === "gzip, br" && + headers.get("content-length") === "29" && + (headers.get("user-agent") === "Go-http-client/1.1" || + headers.get("user-agent") === "Go-http-client/2.0") ) { return new Response(null, { status: 403 }); }