feat(aliyundrive): internal upload (aliyun ECS for Beijing area only) (#3188)

Co-authored-by: wangwuxuan2011 <git@wangwuxuan.cn>
This commit is contained in:
Wuxuan
2023-01-30 11:18:08 +08:00
committed by GitHub
parent c92e11dad5
commit e1cd71616d
3 changed files with 8 additions and 2 deletions

View File

@ -251,7 +251,11 @@ func (d *AliDrive) Put(ctx context.Context, dstDir model.Obj, stream model.FileS
if utils.IsCanceled(ctx) {
return ctx.Err()
}
req, err := http.NewRequest("PUT", partInfo.UploadUrl, io.LimitReader(file, DEFAULT))
url := partInfo.UploadUrl
if d.InternalUpload {
url = partInfo.InternalUploadUrl
}
req, err := http.NewRequest("PUT", url, io.LimitReader(file, DEFAULT))
if err != nil {
return err
}