默认情况下内容压缩不支持Partial Content

This commit is contained in:
GoEdgeLab
2022-12-30 11:44:07 +08:00
parent c3d5354b23
commit 5c46c4bce2

View File

@@ -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
}