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/companion: coerce requestUrl to a string #5128

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Apr 29, 2024

Otherwise we get a TypeError when requestUrl is a URL

Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/companion/lib/server/helpers/request.js b/packages/@uppy/companion/lib/server/helpers/request.js
index 5e93503..4adcc13 100644
--- a/packages/@uppy/companion/lib/server/helpers/request.js
+++ b/packages/@uppy/companion/lib/server/helpers/request.js
@@ -107,7 +107,7 @@ exports.getURLMeta = async (url, blockLocalIPs = false) => {
         // we add random string to avoid duplicate files
         const filename = response.headers["content-disposition"]
           ? contentDisposition.parse(response.headers["content-disposition"]).parameters.filename
-          : path.basename(response.request.requestUrl);
+          : path.basename(`${response.request.requestUrl}`);
         // No need to get the rest of the response, as we only want header (not really relevant for HEAD, but why not)
         stream.destroy();
         resolve({

@aduh95 aduh95 merged commit 4028a6d into transloadit:main Apr 29, 2024
20 checks passed
@aduh95 aduh95 deleted the fix-comapnion-typeerror branch April 29, 2024 16:31
Murderlon added a commit that referenced this pull request May 2, 2024
* main:
  meta: enable prettier for markdown (#5133)
  @uppy/xhr-upload: do not throw when res is missing url (#5132)
  @uppy/companion: coerce `requestUrl` to a string (#5128)
  Release: uppy@3.25.0 (#5127)
  meta: enforce use of `.js` extension in `import type` declarations (#5126)
  @uppy/core: add instance ID to generated IDs (#5080)
  @uppy/core: reference updated i18n in Restricter (#5118)
Murderlon added a commit that referenced this pull request May 2, 2024
* 4.x:
  meta: enable prettier for markdown (#5133)
  @uppy/xhr-upload: do not throw when res is missing url (#5132)
  Release: uppy@4.0.0-beta.4 (#5130)
  meta: fix release script
  Upgrade Yarn to 4.x (#4849)
  @uppy/companion: coerce `requestUrl` to a string (#5128)
  Release: uppy@3.25.0 (#5127)
  meta: enforce use of `.js` extension in `import type` declarations (#5126)
  @uppy/core: add instance ID to generated IDs (#5080)
  @uppy/core: reference updated i18n in Restricter (#5118)
@github-actions github-actions bot mentioned this pull request May 3, 2024
github-actions bot added a commit that referenced this pull request May 3, 2024
| Package          | Version | Package          | Version |
| ---------------- | ------- | ---------------- | ------- |
| @uppy/companion  |  4.13.2 | @uppy/xhr-upload |   3.6.6 |
| @uppy/core       |  3.11.1 | uppy             |  3.25.1 |
| @uppy/locales    |   3.5.3 |                  |         |

- @uppy/locales: Update ru_RU locale  (Uladzislau Bodryi / #5120)
- meta: fix `update-contributors` script (Antoine du Hamel / #5137)
- meta: fix `bullet` setting for ReMark (Antoine du Hamel)
- meta: add prettier to `.md` pre-commit hooks (Antoine du Hamel)
- @uppy/core: make UppyEventMap more readable (Murderlon)
- meta: enable prettier for markdown (Merlijn Vos / #5133)
- @uppy/xhr-upload: do not throw when res is missing url (Merlijn Vos / #5132)
- @uppy/companion: coerce `requestUrl` to a string (Antoine du Hamel / #5128)
github-actions bot added a commit that referenced this pull request May 3, 2024
| Package                   |      Version | Package                   |      Version |
| ------------------------- | ------------ | ------------------------- | ------------ |
| @uppy/audio               | 2.0.0-beta.5 | @uppy/progress-bar        | 4.0.0-beta.4 |
| @uppy/aws-s3              | 4.0.0-beta.3 | @uppy/provider-views      | 4.0.0-beta.5 |
| @uppy/aws-s3-multipart    | 4.0.0-beta.5 | @uppy/react               | 4.0.0-beta.5 |
| @uppy/box                 | 3.0.0-beta.5 | @uppy/redux-dev-tools     | 4.0.0-beta.2 |
| @uppy/companion           | 5.0.0-beta.5 | @uppy/remote-sources      | 2.0.0-beta.4 |
| @uppy/companion-client    | 4.0.0-beta.5 | @uppy/screen-capture      | 4.0.0-beta.4 |
| @uppy/compressor          | 2.0.0-beta.5 | @uppy/status-bar          | 4.0.0-beta.5 |
| @uppy/core                | 4.0.0-beta.5 | @uppy/store-default       | 4.0.0-beta.2 |
| @uppy/dashboard           | 4.0.0-beta.5 | @uppy/store-redux         | 4.0.0-beta.3 |
| @uppy/drag-drop           | 4.0.0-beta.4 | @uppy/svelte              | 4.0.0-beta.3 |
| @uppy/dropbox             | 4.0.0-beta.5 | @uppy/thumbnail-generator | 4.0.0-beta.4 |
| @uppy/facebook            | 4.0.0-beta.5 | @uppy/transloadit         | 4.0.0-beta.5 |
| @uppy/file-input          | 4.0.0-beta.5 | @uppy/tus                 | 4.0.0-beta.4 |
| @uppy/form                | 4.0.0-beta.3 | @uppy/unsplash            | 4.0.0-beta.5 |
| @uppy/golden-retriever    | 4.0.0-beta.4 | @uppy/url                 | 4.0.0-beta.5 |
| @uppy/google-drive        | 4.0.0-beta.5 | @uppy/utils               | 6.0.0-beta.5 |
| @uppy/image-editor        | 3.0.0-beta.3 | @uppy/vue                 | 2.0.0-beta.2 |
| @uppy/informer            | 4.0.0-beta.2 | @uppy/webcam              | 4.0.0-beta.5 |
| @uppy/instagram           | 4.0.0-beta.5 | @uppy/xhr-upload          | 4.0.0-beta.3 |
| @uppy/locales             | 4.0.0-beta.1 | @uppy/zoom                | 3.0.0-beta.5 |
| @uppy/onedrive            | 4.0.0-beta.5 | uppy                      | 4.0.0-beta.5 |

- @uppy/core: make UppyEventMap more readable (Murderlon)
- @uppy/audio,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/remote-sources,@uppy/tus,@uppy/utils: Format (Murderlon)
- @uppy/aws-s3-multipart: Format (Murderlon)
- meta: enable prettier for markdown (Merlijn Vos / #5133)
- @uppy/xhr-upload: do not throw when res is missing url (Merlijn Vos / #5132)
- @uppy/companion: coerce `requestUrl` to a string (Antoine du Hamel / #5128)
- meta: enforce use of `.js` extension in `import type` declarations (Antoine du Hamel / #5126)
- @uppy/core: add instance ID to generated IDs (Merlijn Vos / #5080)
- @uppy/core: reference updated i18n in Restricter (Merlijn Vos / #5118)
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.

1 participant