Skip to content

Commit

Permalink
fix(115): download issue due to ua (close #3931 in #3932)
Browse files Browse the repository at this point in the history
  • Loading branch information
SheltonZhu authored and xhofe committed Mar 23, 2023
1 parent 0eab31b commit 4fd2c09
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/115/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func (d *Pan115) List(ctx context.Context, dir model.Obj, args model.ListArgs) (
}

func (d *Pan115) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
downloadInfo, err := d.client.Download(file.(driver115.File).PickCode)
downloadInfo, err := d.client.
SetUserAgent(driver115.UA115Browser).
Download(file.(driver115.File).PickCode)
// recover for upload
d.client.SetUserAgent(driver115.UA115Desktop)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 4fd2c09

Please sign in to comment.