Skip to content

Commit

Permalink
feat(115): support 302 redirect (alist-org#5733)
Browse files Browse the repository at this point in the history
  • Loading branch information
foxxorcat authored and EtherealAO committed Apr 12, 2024
1 parent 8a759ac commit 6a83fd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion drivers/115/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ func (d *Pan115) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
if err := d.WaitLimit(ctx); err != nil {
return nil, err
}
var userAgent = args.Header.Get("User-Agent")
if userAgent == "" {
userAgent = driver115.UA115Browser
}

downloadInfo, err := d.client.
DownloadWithUA(file.(*FileObj).PickCode, driver115.UA115Browser)
DownloadWithUA(file.(*FileObj).PickCode, userAgent)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/115/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Addition struct {
var config = driver.Config{
Name: "115 Cloud",
DefaultRoot: "0",
OnlyProxy: true,
//OnlyProxy: true,
//OnlyLocal: true,
NoOverwriteUpload: true,
}
Expand Down

0 comments on commit 6a83fd1

Please sign in to comment.