Skip to content

Commit

Permalink
Update lib/s3middleware/userMetadata.ts
Browse files Browse the repository at this point in the history
Co-authored-by: William <[email protected]>
  • Loading branch information
benzekrimaha and williamlardier authored Oct 22, 2024
1 parent c684bd0 commit 09f553c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/s3middleware/userMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export function getMetaHeaders(headers: http.IncomingHttpHeaders) {
const rawHeaders = Object.entries(headers);
const filtered = rawHeaders.filter(([k]) => k.startsWith('x-amz-meta-'));
const totalLength = filtered.reduce((length, [k, v]) => {
if (!v) {return length;}
if (!v) {
return length;
}
return length + k.length + v.toString().length;
}, 0);
if (totalLength <= constants.maximumMetaHeadersSize) {
Expand Down

0 comments on commit 09f553c

Please sign in to comment.