fix: copy tasks using multi-thread downloader can't be canceled (#5028)
#4981 related
This commit is contained in:
@ -109,16 +109,11 @@ func ParseRange(s string, size int64) ([]Range, error) { // nolint:gocognit
|
||||
|
||||
func (r Range) MimeHeader(contentType string, size int64) textproto.MIMEHeader {
|
||||
return textproto.MIMEHeader{
|
||||
"Content-Range": {r.contentRange(size)},
|
||||
"Content-Range": {r.ContentRange(size)},
|
||||
"Content-Type": {contentType},
|
||||
}
|
||||
}
|
||||
|
||||
// for http response header
|
||||
func (r Range) contentRange(size int64) string {
|
||||
return fmt.Sprintf("bytes %d-%d/%d", r.Start, r.Start+r.Length-1, size)
|
||||
}
|
||||
|
||||
// ApplyRangeToHttpHeader for http request header
|
||||
func ApplyRangeToHttpHeader(p Range, headerRef http.Header) http.Header {
|
||||
header := headerRef
|
||||
|
Reference in New Issue
Block a user