From 1adc3a3192aed8408851a15698feade94216c724 Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Sun, 30 Mar 2025 17:02:45 +0800 Subject: [PATCH] update --- main.go | 2 +- proxy/handler.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 04b9ee0..4a7d009 100644 --- a/main.go +++ b/main.go @@ -71,7 +71,7 @@ func readFlag() { fmt.Println("[ERROR] cfg flag is deprecated, please use -c instead") fmt.Printf("\n") flag.Usage() - os.Exit(1) + os.Exit(2) return nil }) flag.BoolVar(&showVersion, "v", false, "show version and exit") // 添加-v标志 diff --git a/proxy/handler.go b/proxy/handler.go index 435e7d5..072fd26 100644 --- a/proxy/handler.go +++ b/proxy/handler.go @@ -43,7 +43,7 @@ func NoRouteHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra rawPath := strings.TrimPrefix(string(c.Request.RequestURI()), "/") // 去掉前缀/ matches := re.FindStringSubmatch(rawPath) // 匹配路径 - logInfo("Matches: %v", matches) + logInfo("URL: %v", matches) // 匹配路径错误处理 if len(matches) < 3 { @@ -116,7 +116,7 @@ func NoRouteHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra } // IP METHOD URL USERAGENT PROTO MATCHES - logDebug("%s %s %s %s %s Matches: %v", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), matches) + logDebug("%s %s %s %s %s Matched: %v", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), matcher) switch matcher { case "releases", "blob", "raw", "gist", "api":