From 68e8eca20738ec49c552e78e02e9d814890a1928 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 17 May 2024 11:21:02 +0200 Subject: [PATCH 1/5] @uppy/xhr-upload: fix regression for lowercase HTTP methods --- packages/@uppy/xhr-upload/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@uppy/xhr-upload/src/index.ts b/packages/@uppy/xhr-upload/src/index.ts index e0fa70c11f..cd5cafbc45 100644 --- a/packages/@uppy/xhr-upload/src/index.ts +++ b/packages/@uppy/xhr-upload/src/index.ts @@ -214,6 +214,7 @@ export default class XHRUpload< try { const res = await fetcher(url, { ...options, + method: options?.method?.toUpperCase(), onTimeout: (timeout) => { const seconds = Math.ceil(timeout / 1000) const error = new Error(this.i18n('uploadStalled', { seconds })) From 2aa8ed7163d29727f441c187ea94de99e2dc5663 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 17 May 2024 14:29:41 +0200 Subject: [PATCH 2/5] add deprecation note --- docs/uploader/xhr.mdx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/uploader/xhr.mdx b/docs/uploader/xhr.mdx index 1b1a429ff6..de160b5890 100644 --- a/docs/uploader/xhr.mdx +++ b/docs/uploader/xhr.mdx @@ -87,7 +87,14 @@ URL of the HTTP server (`string`, default: `null`). #### `method` Configures which HTTP method to use for the upload (`string`, default: -`'post'`). +`'POST'`). + +:::note + +Using non-uppercase string for `method` is deprecated and won't be supported in +future versions of Uppy. + +::: #### `formData` From bab688630cb895acc209d0d36aa24c96194eaeab Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 17 May 2024 15:09:04 +0200 Subject: [PATCH 3/5] lint --- docs/uploader/xhr.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/uploader/xhr.mdx b/docs/uploader/xhr.mdx index de160b5890..676bce9e8a 100644 --- a/docs/uploader/xhr.mdx +++ b/docs/uploader/xhr.mdx @@ -91,7 +91,7 @@ Configures which HTTP method to use for the upload (`string`, default: :::note -Using non-uppercase string for `method` is deprecated and won't be supported in +Using non-uppercase string for `method` is deprecated and won’t be supported in future versions of Uppy. ::: From 570f1aa0842656bd547f6f72aa00bfaf735eb26e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 22 May 2024 11:27:38 +0200 Subject: [PATCH 4/5] Update docs/uploader/xhr.mdx --- docs/uploader/xhr.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/uploader/xhr.mdx b/docs/uploader/xhr.mdx index 676bce9e8a..b5b90664b5 100644 --- a/docs/uploader/xhr.mdx +++ b/docs/uploader/xhr.mdx @@ -91,8 +91,9 @@ Configures which HTTP method to use for the upload (`string`, default: :::note -Using non-uppercase string for `method` is deprecated and won’t be supported in -future versions of Uppy. +Uppy is not following the standard and will uppercase the method name. This +behavior will be removed in a future version to align Uppy with the web APIs. +This will affect only users who use custom HTTP method (e.g. `'PATCH'`). ::: From f1a9c1b202e9ee3d1a536087384dee171a82bc7e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 22 May 2024 13:38:03 +0200 Subject: [PATCH 5/5] Update docs/uploader/xhr.mdx Co-authored-by: Merlijn Vos --- docs/uploader/xhr.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/uploader/xhr.mdx b/docs/uploader/xhr.mdx index b5b90664b5..92eef37071 100644 --- a/docs/uploader/xhr.mdx +++ b/docs/uploader/xhr.mdx @@ -93,7 +93,6 @@ Configures which HTTP method to use for the upload (`string`, default: Uppy is not following the standard and will uppercase the method name. This behavior will be removed in a future version to align Uppy with the web APIs. -This will affect only users who use custom HTTP method (e.g. `'PATCH'`). :::