mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-11-25 03:15:19 +08:00
fix(offline_download/http): attach UA to the request (#1347)
fix(simple-http): attach UA to the request
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/OpenListTeam/OpenList/v4/drivers/base"
|
||||
"github.com/OpenListTeam/OpenList/v4/internal/model"
|
||||
"github.com/OpenListTeam/OpenList/v4/internal/offline_download/tool"
|
||||
"github.com/OpenListTeam/OpenList/v4/pkg/http_range"
|
||||
@@ -58,6 +59,7 @@ func (s SimpleHttp) Run(task *tool.DownloadTask) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req.Header.Set("User-Agent", base.UserAgent)
|
||||
if streamPut {
|
||||
req.Header.Set("Range", "bytes=0-")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user