Compare commits

...

2 commits

Author SHA1 Message Date
wjqserver
b86e58cddf 3.5.2 2025-06-11 11:40:00 +08:00
wjqserver
44673b9a3f 3.5.2 2025-06-11 11:39:10 +08:00
5 changed files with 21 additions and 2 deletions

View file

@ -1,5 +1,9 @@
# 更新日志
3.5.2 - 2025-06-11
---
- CHANGE: 加入MPL 2.0许可证, 项目转为双重许可
3.5.1 - 2025-06-09
---
- CHANGE: 大幅优化`Matcher`的性能, 实现零分配, 大幅提升性能; 单次操作时间: `254.3 ns/op` => `29.59 ns/op`

View file

@ -99,7 +99,7 @@ WJQserver Studio 开源许可证
* 8.3 版本更新: 授权方可能会发布本许可证的修订版本或新版本。您可以选择是继续使用本许可证的旧版本还是选择适用新版本。
WJQserver Studio Open Source License
Version v2.0
Version v2.1
Copyright © WJQserver Studio 2024

View file

@ -1 +1 @@
3.5.1
3.5.2

View file

@ -92,6 +92,8 @@ func HealthcheckHandler(c *app.RequestContext, ctx context.Context) {
c.Response.Header.Set("Content-Type", "application/json")
c.JSON(200, (map[string]interface{}{
"Status": "OK",
"Repo": "WJQSERVER-STUDIO/GHProxy",
"Author": "WJQSERVER-STUDIO",
}))
}
@ -99,6 +101,8 @@ func VersionHandler(c *app.RequestContext, ctx context.Context, version string)
c.Response.Header.Set("Content-Type", "application/json")
c.JSON(200, (map[string]interface{}{
"Version": version,
"Repo": "WJQSERVER-STUDIO/GHProxy",
"Author": "WJQSERVER-STUDIO",
}))
}

11
main.go
View file

@ -402,6 +402,16 @@ func init() {
}
}
var viaString string = "WJQSERVER-STUDIO/GHProxy"
func viaHeader() app.HandlerFunc {
return func(ctx context.Context, c *app.RequestContext) {
protoVersion := "1.1"
c.Header("Via", protoVersion+" "+viaString)
c.Next(ctx)
}
}
func main() {
if showVersion || showHelp {
return
@ -450,6 +460,7 @@ func main() {
r.Use(recovery.Recovery()) // Recovery中间件
r.Use(loggin.Middleware()) // log中间件
r.Use(viaHeader())
setupApi(cfg, r, version)
setupPages(cfg, r)