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

This commit is contained in:
刘祥超
2022-12-30 11:44:07 +08:00
parent e87f031293
commit 9fed1141c2

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
}