修复分区内容长度判断错误的问题

This commit is contained in:
GoEdgeLab
2023-07-26 14:48:07 +08:00
parent 7893f1258b
commit 17788818ab

View File

@@ -324,11 +324,11 @@ func (this *HTTPWriter) PrepareCache(resp *http.Response, size int64) {
// 待写入尺寸
var totalSize = size
if totalSize < 0 && this.isPartial {
if this.isPartial {
var contentRange = resp.Header.Get("Content-Range")
if len(contentRange) > 0 {
_, partialTotalSize := httpRequestParseContentRangeHeader(contentRange)
if partialTotalSize > 0 {
if partialTotalSize > 0 && partialTotalSize > totalSize {
totalSize = partialTotalSize
}
}