From 9cc17cec9af7ae829e6f1ce8a64f19d8d9730241 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 1 Sep 2020 16:04:32 +0100 Subject: [PATCH] swift: fix missing hash from object returned from upload Before this fix we were reading the hash from the upload using the string "ETag", however the go runtime normalises the tag into "Etag" so we were in fact always reading an empty string. This bug was introduced in aeea4430d5fe8896 swift: efficiency: slim Object and reduce requests on upload It was spotted by the integration tests. The fix was just to use the canonical form "Etag" instead of "ETag". --- backend/swift/swift.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/swift/swift.go b/backend/swift/swift.go index c44b7feec..08e81d899 100644 --- a/backend/swift/swift.go +++ b/backend/swift/swift.go @@ -1335,7 +1335,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op // object has been safely uploaded o.lastModified = modTime o.size = size - o.md5 = rxHeaders["ETag"] + o.md5 = rxHeaders["Etag"] o.contentType = contentType o.headers = headers if inCount != nil {