Skip to content

Commit

Permalink
@uppy/xhr-upload: fix regression for lowercase HTTP methods (#5179)
Browse files Browse the repository at this point in the history
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
  • Loading branch information
aduh95 and Murderlon committed May 22, 2024
1 parent 3cc8df8 commit 67bd2fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/uploader/xhr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/xhr-upload/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }))
Expand Down

0 comments on commit 67bd2fd

Please sign in to comment.