Преглед на файлове

@uppy/xhr-upload: fix regression for lowercase HTTP methods (#5179)

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
Antoine du Hamel преди 11 месеца
родител
ревизия
67bd2fdd95
променени са 2 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 8 1
      docs/uploader/xhr.mdx
  2. 1 0
      packages/@uppy/xhr-upload/src/index.ts

+ 8 - 1
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
+
+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.
+
+:::
 
 #### `formData`
 

+ 1 - 0
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 }))