s3store: Accept alternate error response from DigitalOcean Spaces (#507)

* fix digitalocean spaces fetch

* remove log

* remove log

* remove info.Size check

* Add comment

* Delete .gitignore

Co-authored-by: Marius <marius.kleidl@gmail.com>
This commit is contained in:
benito 2021-10-16 03:50:17 +08:00 committed by GitHub
parent dd44267c08
commit 16a3747ec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -498,7 +498,9 @@ func (upload s3Upload) fetchInfo(ctx context.Context) (info handler.FileInfo, er
// when the multipart upload has already been completed or aborted. Since // when the multipart upload has already been completed or aborted. Since
// we already found the info object, we know that the upload has been // we already found the info object, we know that the upload has been
// completed and therefore can ensure the the offset is the size. // completed and therefore can ensure the the offset is the size.
if isAwsError(err, "NoSuchUpload") { // AWS S3 returns NoSuchUpload, but other implementations, such as DigitalOcean
// Spaces, can also return NoSuchKey.
if isAwsError(err, "NoSuchUpload") || isAwsError(err, "NoSuchKey") {
info.Offset = info.Size info.Offset = info.Size
return info, nil return info, nil
} else { } else {