From 7c64f9bff9ecb8e6ca37e327454f9a41e7e425f2 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 29 Apr 2022 10:50:04 +0800 Subject: [PATCH] =?UTF-8?q?WebP=E5=88=A4=E6=96=AD=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E6=97=B6=EF=BC=8C=E5=BF=BD=E7=95=A5ChunkEnco?= =?UTF-8?q?ding=E4=BC=A0=E8=BE=93=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/image_webp_config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 }