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/aws-s3: clarify and warn when incorrect buckets settings are used #5505

Merged
merged 6 commits into from
Nov 11, 2024

Conversation

mifi
Copy link
Contributor

@mifi mifi commented Nov 8, 2024

fixes #5388

also:

  • add new dev uploader s3-non-multipart, that will never use multipart, and s3 will auto-detect (which is the default anyways)
  • add coment and slightly improve types

when CORS is not setup properly on the bucket, it would just fail silently.
now it will show the warning again (because location/etag may also be `undefined`)
that will never use multipart
and `s3` will auto-detect (which is the default anyways)
Copy link
Contributor

github-actions bot commented Nov 8, 2024

Diff output files
diff --git a/packages/@uppy/aws-s3/lib/index.js b/packages/@uppy/aws-s3/lib/index.js
index d49a27a..b6c9105 100644
--- a/packages/@uppy/aws-s3/lib/index.js
+++ b/packages/@uppy/aws-s3/lib/index.js
@@ -500,12 +500,12 @@ export default class AwsS3Multipart extends BasePlugin {
           etag,
           location,
         } = headersMap;
-        if (method.toUpperCase() === "POST" && location === null) {
+        if (method.toUpperCase() === "POST" && location == null) {
           console.warn(
             "AwsS3/Multipart: Could not read the Location header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.",
           );
         }
-        if (etag === null) {
+        if (etag == null) {
           reject(
             new Error(
               "AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.",

needed for s3
private/dev/Dashboard.js Outdated Show resolved Hide resolved
@Murderlon Murderlon changed the title Upload url missing @uppy/aws-s3: clarify and warn when incorrect buckets settings are used Nov 11, 2024
@Murderlon Murderlon merged commit 8cb65bb into main Nov 11, 2024
17 checks passed
@Murderlon Murderlon deleted the uploadUrl-missing branch November 11, 2024 09:34
@github-actions github-actions bot mentioned this pull request Nov 11, 2024
github-actions bot added a commit that referenced this pull request Nov 11, 2024
| Package         | Version | Package         | Version |
| --------------- | ------- | --------------- | ------- |
| @uppy/aws-s3    |   4.1.2 | @uppy/tus       |   4.1.4 |
| @uppy/companion |   5.1.4 | uppy            |   4.7.0 |
| @uppy/locales   |   4.3.0 |                 |         |

- @uppy/aws-s3: clarify and warn when incorrect buckets settings are used (Mikael Finstad / #5505)
- @uppy/tus: fix event upload-success response.body.xhr (ItsOnlyBinary / #5503)
- @uppy/companion: Enable CSRF protection in grant (OAuth2) (Mikael Finstad / #5504)
- @uppy/locales: Add ms_MY (Malay) locale (Salimi / #5488)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upload-success not setting uploadURL correctly
2 participants