create-100x-mobile 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -625,9 +625,17 @@ async function handleUpload(
|
|
|
625
625
|
const objectKey = ["uploads", user.id, uploadId].join("/");
|
|
626
626
|
let object: R2Object;
|
|
627
627
|
try {
|
|
628
|
+
const body = await request.arrayBuffer();
|
|
629
|
+
if (body.byteLength > policy.maxUploadBytes) {
|
|
630
|
+
throw createStorageApiError(
|
|
631
|
+
413,
|
|
632
|
+
"Upload exceeds the configured size limit.",
|
|
633
|
+
{ size: body.byteLength, maxUploadBytes: policy.maxUploadBytes },
|
|
634
|
+
);
|
|
635
|
+
}
|
|
628
636
|
object = await env.STORAGE.put(
|
|
629
637
|
objectKey,
|
|
630
|
-
|
|
638
|
+
body,
|
|
631
639
|
{
|
|
632
640
|
httpMetadata: {
|
|
633
641
|
contentType,
|