This commit is contained in:
wjqserver
2025-06-11 11:39:10 +08:00
parent 5b05588375
commit 44673b9a3f
4 changed files with 17 additions and 2 deletions

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)