Skip to content

Commit e0414e7

Browse files
authored
fix(offline_download/http): attach UA to the request (#1347)
fix(simple-http): attach UA to the request
1 parent b486af0 commit e0414e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/offline_download/http/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"strings"
1111
"time"
1212

13+
"github.com/OpenListTeam/OpenList/v4/drivers/base"
1314
"github.com/OpenListTeam/OpenList/v4/internal/model"
1415
"github.com/OpenListTeam/OpenList/v4/internal/offline_download/tool"
1516
"github.com/OpenListTeam/OpenList/v4/pkg/http_range"
@@ -58,6 +59,7 @@ func (s SimpleHttp) Run(task *tool.DownloadTask) error {
5859
if err != nil {
5960
return err
6061
}
62+
req.Header.Set("User-Agent", base.UserAgent)
6163
if streamPut {
6264
req.Header.Set("Range", "bytes=0-")
6365
}

0 commit comments

Comments
 (0)