Fixing an issue which was alerting, x-amz-meta-fieldname contains an invalid value, this error isn't really documented, but comes from if a metadata tag is sent up with nullish, or a non-string type. Fixing this in the core library, removing an invalid inputs.
This commit is contained in:
parent
21bf12a21c
commit
913eb96ab0
|
@ -163,6 +163,12 @@ export const upload = async ({
|
|||
ContentType: type || CONTENT_TYPE_MAP[extension.toLowerCase()],
|
||||
}
|
||||
if (metadata) {
|
||||
// remove any nullish keys from the metadata object, as these may be considered invalid
|
||||
for (let key of Object.keys(metadata)) {
|
||||
if (!metadata[key] || typeof metadata[key] !== "string") {
|
||||
delete metadata[key]
|
||||
}
|
||||
}
|
||||
config.Metadata = metadata
|
||||
}
|
||||
return objectStore.upload(config).promise()
|
||||
|
|
Loading…
Reference in New Issue