Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Using non-uppercase string for `method` is deprecated and won’t be supported in
future versions of Uppy.

:::
aduh95 marked this conversation as resolved.
Show resolved Hide resolved

#### `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
Loading