diff --git a/pkg/serverconfigs/image_webp_config.go b/pkg/serverconfigs/image_webp_config.go index 0d998f4..f4a6b52 100644 --- a/pkg/serverconfigs/image_webp_config.go +++ b/pkg/serverconfigs/image_webp_config.go @@ -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 }