fix: ensure multipart part sizeBytes are Numbers, not DB strings
This commit is contained in:
+1
-1
@@ -85,7 +85,7 @@ export const listMultipartParts = async (uploadId: string): Promise<MultipartPar
|
|||||||
telegramFileId: r.telegram_file_id as string,
|
telegramFileId: r.telegram_file_id as string,
|
||||||
telegramFileUniqueId: r.telegram_file_unique_id as string,
|
telegramFileUniqueId: r.telegram_file_unique_id as string,
|
||||||
storageMessageId: r.storage_message_id as number,
|
storageMessageId: r.storage_message_id as number,
|
||||||
sizeBytes: r.size_bytes as number,
|
sizeBytes: Number(r.size_bytes),
|
||||||
etag: r.etag as string,
|
etag: r.etag as string,
|
||||||
createdAt: new Date(r.created_at as string),
|
createdAt: new Date(r.created_at as string),
|
||||||
}));
|
}));
|
||||||
|
|||||||
+1
-1
@@ -393,7 +393,7 @@ const handleGetMultipartObject = async (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const totalSize = parts.reduce((sum, p) => sum + p.sizeBytes, 0);
|
const totalSize = parts.reduce((sum, p) => sum + Number(p.sizeBytes), 0);
|
||||||
const range = parseRangeHeader(headers.range || null, totalSize);
|
const range = parseRangeHeader(headers.range || null, totalSize);
|
||||||
if (range.type === 'invalid') {
|
if (range.type === 'invalid') {
|
||||||
return s3ErrorResponse(
|
return s3ErrorResponse(
|
||||||
|
|||||||
Reference in New Issue
Block a user