fix(189pc): delete user-agent for upload

pull/1093/head
Xhofe 2022-05-11 20:01:15 +08:00
parent 279111a8e2
commit 4b635f06e3
1 changed files with 2 additions and 0 deletions

View File

@ -607,6 +607,7 @@ func (driver Cloud189) CommonUpload(file *model.FileStream, parentFile *model.Fi
uploadData := uploadUrl.UploadUrls[fmt.Sprint("partNumber_", i)]
req, _ := http.NewRequest(http.MethodPut, uploadData.RequestURL, byteData)
req.Header.Del("User-Agent")
for k, v := range ParseHttpHeader(uploadData.RequestHeader) {
req.Header.Set(k, v)
}
@ -717,6 +718,7 @@ func (driver Cloud189) FastUpload(file *model.FileStream, parentFile *model.File
for i := 1; i <= count; i++ {
uploadData := uploadUrls.UploadUrls[fmt.Sprint("partNumber_", i)]
req, _ := http.NewRequest(http.MethodPut, uploadData.RequestURL, io.NewSectionReader(tempFile, int64(i-1)*DEFAULT, DEFAULT))
req.Header.Del("User-Agent")
for k, v := range ParseHttpHeader(uploadData.RequestHeader) {
req.Header.Set(k, v)
}