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
eab156729d
commit
862525cc0e
|
@ -163,6 +163,12 @@ export const upload = async ({
|
||||||
ContentType: type || CONTENT_TYPE_MAP[extension.toLowerCase()],
|
ContentType: type || CONTENT_TYPE_MAP[extension.toLowerCase()],
|
||||||
}
|
}
|
||||||
if (metadata) {
|
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
|
config.Metadata = metadata
|
||||||
}
|
}
|
||||||
return objectStore.upload(config).promise()
|
return objectStore.upload(config).promise()
|
||||||
|
|
Loading…
Reference in New Issue