1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 23:30:50 +00:00

Merge pull request #4014 from jianzhiyao/develop

over size file do not run openFile
This commit is contained in:
Ming Deng 2020-06-19 20:19:16 +08:00 committed by GitHub
commit b9fbcbd906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)