From d0cc2d7e517f5c0d299ef0b0a27782e4e6ce7e7c Mon Sep 17 00:00:00 2001 From: Murderlon Date: Wed, 1 May 2024 10:29:15 +0200 Subject: [PATCH] @uppy/xhr-upload: do not throw when res is missing url --- packages/@uppy/xhr-upload/src/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/@uppy/xhr-upload/src/index.ts b/packages/@uppy/xhr-upload/src/index.ts index c45dbb19d5..e0fa70c11f 100644 --- a/packages/@uppy/xhr-upload/src/index.ts +++ b/packages/@uppy/xhr-upload/src/index.ts @@ -239,12 +239,9 @@ export default class XHRUpload< } const body = this.opts.getResponseData(res.responseText, res) - const uploadURL = body[this.opts.responseUrlFieldName] - if (typeof uploadURL !== 'string') { - throw new Error( - `The received response did not include a valid URL for key ${this.opts.responseUrlFieldName}`, - ) - } + const uploadURL = body?.[this.opts.responseUrlFieldName] as + | string + | undefined for (const file of files) { this.uppy.emit('upload-success', file, {