WebP判断内容长度时,忽略ChunkEncoding传输的内容

This commit is contained in:
GoEdgeLab
2022-04-29 10:50:04 +08:00
parent 97a622f5f2
commit 7c64f9bff9

View File

@@ -75,8 +75,13 @@ func (this *WebPImageConfig) MatchResponse(mimeType string, contentLength int64,
}
}
// no content
if contentLength == 0 {
return false
}
// min length
if this.minLength > 0 && contentLength < this.minLength {
if this.minLength > 0 && contentLength >= 0 && contentLength < this.minLength {
return false
}