fix(115): data race in `Link` (#5253)

pull/5260/head
Ovear 2023-09-21 13:39:07 +08:00 committed by GitHub
parent f0981a0c8d
commit 2a6ab77295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -45,10 +45,7 @@ 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.
SetUserAgent(driver115.UA115Browser).
Download(file.(*FileObj).PickCode)
// recover for upload
d.client.SetUserAgent(driver115.UA115Desktop)
DownloadWithUA(file.(*FileObj).PickCode, driver115.UA115Browser)
if err != nil {
return nil, err
}