Skip to content

Commit 44546a4

Browse files
author
jojoliang
committed
optional header for complete upload part
1 parent d37fd23 commit 44546a4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

object_part.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ func (s *ObjectService) ListParts(ctx context.Context, name, uploadID string, op
114114

115115
// CompleteMultipartUploadOptions is the option of CompleteMultipartUpload
116116
type CompleteMultipartUploadOptions struct {
117-
XMLName xml.Name `xml:"CompleteMultipartUpload"`
118-
Parts []Object `xml:"Part"`
117+
XMLName xml.Name `xml:"CompleteMultipartUpload" header:"-" url:"-"`
118+
Parts []Object `xml:"Part" header:"-" url:"-"`
119+
XOptionHeader *http.Header `header:"-,omitempty" xml:"-" url:"-"`
119120
}
120121

121122
// CompleteMultipartUploadResult is the result CompleteMultipartUpload
@@ -161,11 +162,12 @@ func (s *ObjectService) CompleteMultipartUpload(ctx context.Context, name, uploa
161162
u := fmt.Sprintf("/%s?uploadId=%s", encodeURIComponent(name), uploadID)
162163
var res CompleteMultipartUploadResult
163164
sendOpt := sendOptions{
164-
baseURL: s.client.BaseURL.BucketURL,
165-
uri: u,
166-
method: http.MethodPost,
167-
body: opt,
168-
result: &res,
165+
baseURL: s.client.BaseURL.BucketURL,
166+
uri: u,
167+
method: http.MethodPost,
168+
optHeader: opt,
169+
body: opt,
170+
result: &res,
169171
}
170172
resp, err := s.client.send(ctx, &sendOpt)
171173
// If the error occurs during the copy operation, the error response is embedded in the 200 OK response. This means that a 200 OK response can contain either a success or an error.

0 commit comments

Comments
 (0)