Skip to content

Commit

Permalink
fix: download block ua
Browse files Browse the repository at this point in the history
  • Loading branch information
Akegarasu committed Jun 22, 2022
1 parent 7707e78 commit 06b43dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion global/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func DownloadFileMultiThreading(url, path string, limit int64, threadCount int,
req.Header.Set(k, v)
}

if _, ok := headers["User-Agent"]; ok {
if _, ok := headers["User-Agent"]; !ok {
req.Header["User-Agent"] = []string{UserAgent}
}
req.Header.Set("range", "bytes="+strconv.FormatInt(block.BeginOffset, 10)+"-"+strconv.FormatInt(block.EndOffset, 10))
Expand Down

0 comments on commit 06b43dd

Please sign in to comment.