From 9fed1141c27ad5f29dbd52ba574f44f8e153692e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 30 Dec 2022 11:44:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=8E=8B=E7=BC=A9=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?Partial=20Content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_writer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/nodes/http_writer.go b/internal/nodes/http_writer.go index 7cc111e..8d61f90 100644 --- a/internal/nodes/http_writer.go +++ b/internal/nodes/http_writer.go @@ -584,6 +584,11 @@ func (this *HTTPWriter) PrepareCompression(resp *http.Response, size int64) { return } + // 分区内容不压缩,防止读取失败 + if !this.compressionConfig.EnablePartialContent && this.StatusCode() == http.StatusPartialContent { + return + } + if this.compressionConfig.Level <= 0 { return }