From 2e6f54b7e73fb9fa474c36b72d00174a90535e01 Mon Sep 17 00:00:00 2001 From: AzenKain Date: Fri, 12 Jun 2026 12:17:41 +0700 Subject: [PATCH] feat: implement EmptyUrls response handling and add release version configuration --- config.go | 4 +++- main.go | 11 +++++++++++ script/release.json | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index 7b7d2c0..080ddd2 100644 --- a/config.go +++ b/config.go @@ -23,7 +23,9 @@ var AlwaysIgnoreDomains = []string{ "autopatchos.starrails.com", } -var AlwaysIgnoreUrls = []string{ +var AlwaysIgnoreUrls = []string{} + +var EmptyUrls = []string{ "/query_security_file", } diff --git a/main.go b/main.go index fbccdd2..f8e439c 100644 --- a/main.go +++ b/main.go @@ -141,6 +141,17 @@ func main() { return req, nil } + if matchURL(path, EmptyUrls) { + full := req.URL.String() + zlog.Warn().Str("url", full).Msg("Empty URL Response") + return req, goproxy.NewResponse( + req, + goproxy.ContentTypeText, + http.StatusOK, + "", + ) + } + if matchDomain(host, RedirectDomains) { if matchURL(path, BlockUrls) { full := req.URL.String() diff --git a/script/release.json b/script/release.json index 3c8041b..eefbcfa 100644 --- a/script/release.json +++ b/script/release.json @@ -1,5 +1,5 @@ { - "tag": "1.3-01", - "title": "PreBuild Version 1.3 - 01" + "tag": "1.3-02", + "title": "PreBuild Version 1.3 - 02" } \ No newline at end of file