From 24167a38f076b6ef221e64a9cfaf0fa55d09d23a Mon Sep 17 00:00:00 2001 From: Farnabaz Date: Thu, 6 Jun 2024 15:23:42 +0200 Subject: [PATCH] fix(handleUpload): ensure valid http method (#148) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Chopin --- src/runtime/server/utils/blob.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/server/utils/blob.ts b/src/runtime/server/utils/blob.ts index 54e5598f..4e81cddc 100644 --- a/src/runtime/server/utils/blob.ts +++ b/src/runtime/server/utils/blob.ts @@ -398,6 +398,8 @@ export function hubBlob(): HubBlob { return mapR2MpuToBlobMpu(mpu) }, async handleUpload(event: H3Event, options: BlobUploadOptions = {}) { + assertMethod(event, ['POST', 'PUT', 'PATCH']) + options = defu(options, { formKey: 'files', multiple: true