mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
24w15d
This commit is contained in:
parent
03118a24a3
commit
6dc20398ae
3 changed files with 70 additions and 8 deletions
|
|
@ -42,10 +42,12 @@ func InitHandleRouter(cfg *config.Config, router *gin.Engine) {
|
|||
}
|
||||
|
||||
func SizeLimitHandler(cfg *config.Config, c *gin.Context) {
|
||||
// 转换为MB
|
||||
sizeLimit := cfg.Server.SizeLimit / 1024 / 1024
|
||||
// 设置响应头
|
||||
c.Writer.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(c.Writer).Encode(map[string]interface{}{
|
||||
"MaxResponseBodySize": cfg.Server.SizeLimit,
|
||||
"MaxResponseBodySize": sizeLimit,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue