Skip to content

Commit

Permalink
big size file lead to memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
jianzhiyao committed Jun 16, 2020
1 parent c265f6e commit 8160059
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions staticfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8160059

Please sign in to comment.