fix(offline_download/http): attach UA to the request (#1347)

fix(simple-http): attach UA to the request
This commit is contained in:
KirCute
2025-09-29 22:13:00 +08:00
committed by GitHub
parent b486af0031
commit e0414e7110

View File

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