diff --git a/bucket_encryption_test.go b/bucket_encryption_test.go index 64be1e1..f1dd306 100644 --- a/bucket_encryption_test.go +++ b/bucket_encryption_test.go @@ -21,9 +21,9 @@ func TestBucketService_GetEncryption(t *testing.T) { testFormValues(t, r, vs) fmt.Fprint(w, ` - + AES256 - + `) diff --git a/cos.go b/cos.go index 665084f..42ca376 100644 --- a/cos.go +++ b/cos.go @@ -22,7 +22,7 @@ import ( const ( // Version current go sdk version - Version = "0.7.10" + Version = "0.7.11" userAgent = "cos-go-sdk-v5/" + Version contentTypeXML = "application/xml" defaultServiceBaseURL = "http://service.cos.myqcloud.com" diff --git a/object.go b/object.go index 60864df..f7e5fbb 100644 --- a/object.go +++ b/object.go @@ -284,6 +284,7 @@ type ObjectDeleteOptions struct { XCosSSECustomerKeyMD5 string `header:"x-cos-server-side-encryption-customer-key-MD5,omitempty" url:"-" xml:"-"` //兼容其他自定义头部 XOptionHeader *http.Header `header:"-,omitempty" url:"-" xml:"-"` + VersionId string `header:"-" url:"VersionId,omitempty" xml:"-"` } // Delete Object请求可以将一个文件(Object)删除。 @@ -304,6 +305,7 @@ func (s *ObjectService) Delete(ctx context.Context, name string, opt ...*ObjectD uri: "/" + encodeURIComponent(name), method: http.MethodDelete, optHeader: optHeader, + optQuery: optHeader, } resp, err := s.client.send(ctx, &sendOpt) return resp, err @@ -440,9 +442,10 @@ type ObjectDeleteMultiResult struct { XMLName xml.Name `xml:"DeleteResult"` DeletedObjects []Object `xml:"Deleted,omitempty"` Errors []struct { - Key string - Code string - Message string + Key string `xml:",omitempty"` + Code string `xml:",omitempty"` + Message string `xml:",omitempty"` + VersionId string `xml:",omitempty"` } `xml:"Error,omitempty"` } @@ -472,6 +475,7 @@ type Object struct { LastModified string `xml:",omitempty"` StorageClass string `xml:",omitempty"` Owner *Owner `xml:",omitempty"` + VersionId string `xml:",omitempty"` } // MultiUploadOptions is the option of the multiupload,