fix(115): download issue due to ua (close #3931 in #3932)

pull/3940/head
sheltonzhu 2023-03-23 22:56:14 +08:00 committed by Andy Hsu
parent 0eab31bdf5
commit 4fd2c09845
1 changed files with 5 additions and 1 deletions

View File

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