mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
3.5.2
This commit is contained in:
parent
5b05588375
commit
44673b9a3f
4 changed files with 17 additions and 2 deletions
11
main.go
11
main.go
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue