big size file lead to memory leak

This commit is contained in:
jianzhiyao 2020-06-16 14:56:58 +08:00
parent c265f6e49c
commit 8160059182
1 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,10 @@ func serverStaticRouter(ctx *context.Context) {
http.ServeFile(ctx.ResponseWriter, ctx.Request, filePath)
}
return
} else if fileInfo.Size() > int64(BConfig.WebConfig.StaticCacheFileSize) {
//over size file serve with http module
http.ServeFile(ctx.ResponseWriter, ctx.Request, filePath)
return
}
var enableCompress = BConfig.EnableGzip && isStaticCompress(filePath)