mirror of https://github.com/minio/minio.git
Use canonicalETag helper wherever needed. (#3910)
This commit is contained in:
parent
ae4361cc45
commit
6509589adb
|
@ -25,7 +25,6 @@ import (
|
|||
"path"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
mux "github.com/gorilla/mux"
|
||||
)
|
||||
|
@ -874,8 +873,7 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite
|
|||
// Complete parts.
|
||||
var completeParts []completePart
|
||||
for _, part := range complMultipartUpload.Parts {
|
||||
part.ETag = strings.TrimPrefix(part.ETag, "\"")
|
||||
part.ETag = strings.TrimSuffix(part.ETag, "\"")
|
||||
part.ETag = canonicalizeETag(part.ETag)
|
||||
completeParts = append(completeParts, part)
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ import (
|
|||
"net/http/httptest"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
|
@ -1037,7 +1036,7 @@ func testAPICopyObjectPartHandlerSanity(obj ObjectLayer, instanceType, bucketNam
|
|||
|
||||
parts = append(parts, completePart{
|
||||
PartNumber: partNumber,
|
||||
ETag: strings.Trim(resp.ETag, "\""),
|
||||
ETag: canonicalizeETag(resp.ETag),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -2579,10 +2579,10 @@ func (s *TestSuiteCommon) TestObjectMultipart(c *C) {
|
|||
c.Assert(response.StatusCode, Equals, http.StatusOK)
|
||||
var parts []completePart
|
||||
for _, part := range completeUploads.Parts {
|
||||
part.ETag = strings.Trim(part.ETag, "\"")
|
||||
part.ETag = canonicalizeETag(part.ETag)
|
||||
parts = append(parts, part)
|
||||
}
|
||||
etag, err := getCompleteMultipartMD5(parts)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(strings.Trim(response.Header.Get("Etag"), "\""), Equals, etag)
|
||||
c.Assert(canonicalizeETag(response.Header.Get("Etag")), Equals, etag)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue