From 47de48bccee4b68ac5de153d14625e81f46b185c Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Thu, 24 Apr 2025 18:27:15 +0800 Subject: [PATCH] 3.1.0 --- CHANGELOG.md | 14 ++++++++++++++ VERSION | 2 +- proxy/handler.go | 2 +- proxy/routing.go | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab57d36..9f96690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # 更新日志 +3.1.0 - 2025-04-24 +--- +- CHANGE: 对标准url使用`HertZ`路由匹配器, 而不是自制匹配器, 以提升效率 +- CHANGE: 使用`bodystream`进行req方向的body复制, 而不是使用额外的`buffer reader` +- CHANGE: 使用`HertZ`的`requestContext`传递matcher参数, 而不是`25w30a`中的ctx +- CHANGE: 改进`rate`模块, 避免并发竞争问题 +- CHANGE: 将大部分状态码返回改为新的`html/tmpl`方式处理 +- CHANGE: 修改部分log等级 +- FIX: 修正默认配置的填充错误 +- CHANGE: 使用go `html/tmpl`处理状态码页面, 同时实现错误信息显示 +- CHANGE: 改进handle, 复用共同部分 +- CHANGE: 细化url匹配的返回码处理 +- CHANGE: 增加404界面 + 25w30e - 2025-04-24 --- - PRE-RELEASE: 此版本是v3.1.0预发布版本,请勿在生产环境中使用; diff --git a/VERSION b/VERSION index 282895a..a0cd9f0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.3 \ No newline at end of file +3.1.0 \ No newline at end of file diff --git a/proxy/handler.go b/proxy/handler.go index e3b51e9..bdd7ecb 100644 --- a/proxy/handler.go +++ b/proxy/handler.go @@ -53,7 +53,7 @@ func NoRouteHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra return } - logInfo("%s %s %s %s %s Matched-Username: %s, Matched-Repo: %s", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), user, repo) + logDump("%s %s %s %s %s Matched-Username: %s, Matched-Repo: %s", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), user, repo) logDump("%s", c.Request.Header.Header()) shoudBreak = listCheck(cfg, c, user, repo, rawPath) diff --git a/proxy/routing.go b/proxy/routing.go index 893c994..a3135ec 100644 --- a/proxy/routing.go +++ b/proxy/routing.go @@ -35,7 +35,7 @@ func RoutingHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra repo = c.Param("repo") matcher = c.GetString("matcher") - logInfo("%s %s %s %s %s Matched-Username: %s, Matched-Repo: %s", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), user, repo) + logDump("%s %s %s %s %s Matched-Username: %s, Matched-Repo: %s", c.ClientIP(), c.Method(), rawPath, c.Request.Header.UserAgent(), c.Request.Header.GetProtocol(), user, repo) logDump("%s", c.Request.Header.Header()) shoudBreak = listCheck(cfg, c, user, repo, rawPath)