1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 19:43:49 +08:00

Merge pull request #1551 from Akegarasu/fix-ua

fix: download block ua
This commit is contained in:
Mrs4s 2022-06-22 22:54:09 +08:00 committed by GitHub
commit 5cf5bf7a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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