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

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented May 17, 2024

We might want to revert that in 4.x branch.

Fixes: #5165

Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/xhr-upload/lib/index.js b/packages/@uppy/xhr-upload/lib/index.js
index 215dbfa..3314979 100644
--- a/packages/@uppy/xhr-upload/lib/index.js
+++ b/packages/@uppy/xhr-upload/lib/index.js
@@ -152,8 +152,12 @@ export default class XHRUpload extends BasePlugin {
     _classPrivateFieldLooseBase(this, _getFetcher)[_getFetcher] = files => {
       return async (url, options) => {
         try {
+          var _options$method;
           const res = await fetcher(url, {
             ...options,
+            method: options == null || (_options$method = options.method) == null
+              ? void 0
+              : _options$method.toUpperCase(),
             onTimeout: timeout => {
               const seconds = Math.ceil(timeout / 1000);
               const error = new Error(this.i18n("uploadStalled", {

docs/uploader/xhr.mdx Outdated Show resolved Hide resolved
Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go after this suggestion 👍

docs/uploader/xhr.mdx Outdated Show resolved Hide resolved
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
@aduh95 aduh95 merged commit 67bd2fd into transloadit:main May 22, 2024
17 checks passed
@aduh95 aduh95 deleted the xhr-upload-lowercase-methods branch May 22, 2024 11:40
@aduh95
Copy link
Contributor Author

aduh95 commented May 22, 2024

N.B.: this change won't be included on the 4.x branch

@github-actions github-actions bot mentioned this pull request May 23, 2024
github-actions bot added a commit that referenced this pull request May 23, 2024
| Package           | Version | Package           | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/transloadit |   3.6.2 | uppy              |  3.25.5 |
| @uppy/xhr-upload  |   3.6.7 |                   |         |

- @uppy/transloadit: do not cancel assembly when removing all files (Merlijn Vos / #5191)
- @uppy/xhr-upload: fix regression for lowercase HTTP methods (Antoine du Hamel / #5179)
- meta: improve changelog generator (Antoine du Hamel / #5190)
github-actions bot added a commit that referenced this pull request May 23, 2024
| Package           |      Version | Package           |      Version |
| ----------------- | ------------ | ----------------- | ------------ |
| @uppy/companion   | 5.0.0-beta.8 | @uppy/xhr-upload  | 4.0.0-beta.5 |
| @uppy/transloadit | 4.0.0-beta.6 | uppy              | 4.0.0-beta.9 |

- @uppy/companion: remove `chalk` from dependencies (Antoine du Hamel / #5178)
- @uppy/transloadit: do not cancel assembly when removing all files (Merlijn Vos / #5191)
- @uppy/xhr-upload: fix regression for lowercase HTTP methods (Antoine du Hamel / #5179)
- meta: improve changelog generator (Antoine du Hamel / #5190)
Murderlon added a commit that referenced this pull request May 28, 2024
* 4.x: (38 commits)
  docs: assume tree-shaking bundler is the most common case (#5160)
  @uppy/core: remove `reason` (#5159)
  Release: uppy@4.0.0-beta.9 (#5194)
  Release: uppy@3.25.5 (#5193)
  @uppy/companion: remove `chalk` from dependencies (#5178)
  @uppy/transloadit: do not cancel assembly when removing all files (#5191)
  @uppy/xhr-upload: fix regression for lowercase HTTP methods (#5179)
  meta: improve changelog generator (#5190)
  Release: uppy@4.0.0-beta.8 (#5189)
  examples: add SvelteKit example (#5181)
  @uppy/companion: fix missing `await`
  Release: uppy@3.25.4 (#5188)
  @uppy/svelte: do not attempt removing plugin before it's created (#5186)
  Update facebook.mdx
  fixup! @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/core: resolve some (breaking) TODOs (#4824)
  @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/companion: fix google drive gsuite export large size (#5144)
  @uppy/companion: encode `uploadId` (#5168)
  @uppy/companion: bump `express-session` (#5177)
  ...
Murderlon added a commit that referenced this pull request Jun 10, 2024
* main: (262 commits)
  Release: uppy@3.26.0 (#5223)
  meta: remove Companion's `prepublishOnly` (#5220)
  docs: document clearUploadedFiles (#5204)
  @uppy/webcam: add missing types for `recordedVideo` (#5208)
  @uppy/core: check capabilities in clearUploadedFiles (#5201)
  PartialTree - change the `maxTotalFileSize` error (#5203)
  @uppy/transloadit: remove `updateNumberOfFilesInAssembly` (#5202)
  @uppy/aws-s3: resolve all headers on response (#5195)
  Improve provider docs: OneDrive (#5196)
  Release: uppy@3.25.5 (#5193)
  @uppy/transloadit: do not cancel assembly when removing all files (#5191)
  @uppy/xhr-upload: fix regression for lowercase HTTP methods (#5179)
  meta: improve changelog generator (#5190)
  Release: uppy@3.25.4 (#5188)
  @uppy/svelte: do not attempt removing plugin before it's created (#5186)
  Update facebook.mdx
  fixup! @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/companion: fix google drive gsuite export large size (#5144)
  Improve provider docs: Box & Zoom (#5166)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest version of @uppy/xhr-upload doesn't support PATCH method
2 participants