Skip to content

Commit e34b7a2

Browse files
authoredSep 26, 2022
Fix upload ID when using S3 store with Digital Ocean Spaces (#296)
Digital Ocean Spaces (S3 compatible object storage) sends the upload id information in metadata as `upload-id` instead `upload_id`, so the `_getMetadata` method of `S3Store` returns an empty upload id.
1 parent 6f4cca6 commit e34b7a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎lib/stores/S3Store.js

+2
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ class S3Store extends DataStore {
233233
.then((data) => {
234234
this.cache[file_id] = Object.assign({}, data.Metadata, {
235235
file: JSON.parse(data.Metadata.file),
236+
// Patch for Digital Ocean: if key upload_id (AWS, standard) doesn't exist in Metadata object, fallback to upload-id (DO)
237+
upload_id: data.Metadata.upload_id || data.Metadata['upload-id'],
236238
});
237239

238240
return this.cache[file_id];

0 commit comments

Comments
 (0)
Please sign in to comment.