-
Notifications
You must be signed in to change notification settings - Fork 584
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
SignatureDoesNotMatch while uploading an object to S3 with ContentType #1800
SignatureDoesNotMatch while uploading an object to S3 with ContentType #1800
Comments
Adding |
Hi @AllanZhengYP, any chance you have an ETA on this fix? Or are there any known workarounds? |
I'm actually working around it with middleware until this is fixed; in case this is helpful to anyone else:
|
Maybe this is assumed but I wanted to add that this issue also plagues the v3 modular interface. Also @adamelmore middleware workaround gets past the issue for the modular interface. |
1. One needs MetadataDirective: 'REPLACE' when using object copying to update metadata. 2. One currently needs the workaround described in aws/aws-sdk-js-v3#1800 (comment) until the bug in the s3 SDK v3 is fixed.
Ran into this as well. Adding ContentType results in |
1. One needs MetadataDirective: 'REPLACE' when using object copying to update metadata. 2. One currently needs the workaround described in aws/aws-sdk-js-v3#1800 (comment) until the bug in the s3 SDK v3 is fixed.
* WIP for storage abstraction * Improvements to the storage client abstraction * WIP for storage abstraction. Likely not buildable * Switch over to published storage providers * Minor lint fixes * The short deployer test suite is passing now. Storage provider at 0.0.2, GCS provider at 0.0.3. * Add provider field to storage key, dispatch on it * Fix omitted await operations from recent revision * Initial cut on s3 storage provider. Only some operations supported (WIP) * Improvements to storage provider, now 0.0.7 * Adjust to latest storage-provider interface Storage provider now at 0.0.7, storage-gcs now at 0.0.5 * Complete functionality for awsprovider Test needs updating to cover the added functionality. * Adjust to latest storage provider interface * Bug fix: don't destructure what might be undefined * Start using/testing the s3 storage provider * Deal with missing Contents on vacuous ListObjects * Need @types/node We were accidentally borrowing it from the parent node_modules, which won't necessarily exist. * Need @types/node, url-parse, and tslib dependents We were accidentally borrowing these from the parent node_modules but that won't always be populated. * Need @types/node, debug, and memory-streams We were accidentally borrowing these from the parent node_modules which won't always exist. * Fix things revealed by testing (incl. workaround) 1. One needs MetadataDirective: 'REPLACE' when using object copying to update metadata. 2. One currently needs the workaround described in aws/aws-sdk-js-v3#1800 (comment) until the bug in the s3 SDK v3 is fixed. * Numerous changes to get initial test working Works on both scality and AWS. Includes a workaround for the problem with content-type metadata. Publishes new versions 8 of base, 6 of gcs, 3 of aws. Removes secrets from test. * Ensure that gcs provider is statically required This is needed for correct webpacking. Getting other storage providers to be webpacked is for another day. * s3 storage provider acl and url improvements * Latest SDK, which works with s3
The HTTP request class doesn't have any implementations to insure case-insensitivity of the http headers. So we need to be mindful when populating these headers. Otherwise, the reqeust signature will be messed up. This change will ensure the protocol-specific default headers like content-type will be overriden by the serialized header if exists. For other headers added through middleware stack either by customization or users, it wouldn't affect signing or sending as long as the request doesn't contain same header names in different casing. All the internal headers will be consistent. But users should be careful when they are adding their own headers. We don't add middleware to lowercase all headers to prevent alternating the users' customizations. Ref: aws#1800
The HTTP request class doesn't have any implementations to insure case-insensitivity of the http headers. So we need to be mindful when populating these headers. Otherwise, the reqeust signature will be messed up. This change will ensure the protocol-specific default headers like content-type will be overriden by the serialized header if exists. For other headers added through middleware stack either by customization or users, it wouldn't affect signing or sending as long as the request doesn't contain same header names in different casing. All the internal headers will be consistent. But users should be careful when they are adding their own headers. We don't add middleware to lowercase all headers to prevent alternating the users' customizations. Ref: aws/aws-sdk-js-v3#1800
The HTTP request class doesn't have any implementations to insure case-insensitivity of the http headers. So we need to be mindful when populating these headers. Otherwise, the reqeust signature will be messed up. This change will ensure the protocol-specific default headers like content-type will be overriden by the serialized header if exists. For other headers added through middleware stack either by customization or users, it wouldn't affect signing or sending as long as the request doesn't contain same header names in different casing. All the internal headers will be consistent. But users should be careful when they are adding their own headers. We don't add middleware to lowercase all headers to prevent alternating the users' customizations. Ref: aws#1800
The HTTP request class doesn't have any implementations to insure case-insensitivity of the http headers. So we need to be mindful when populating these headers. Otherwise, the reqeust signature will be messed up. This change will ensure the protocol-specific default headers like content-type will be overriden by the serialized header if exists. For other headers added through middleware stack either by customization or users, it wouldn't affect signing or sending as long as the request doesn't contain same header names in different casing. All the internal headers will be consistent. But users should be careful when they are adding their own headers. We don't add middleware to lowercase all headers to prevent alternating the users' customizations. Ref: aws/aws-sdk-js-v3#1800
The HTTP request class doesn't have any implementations to insure case-insensitivity of the http headers. So we need to be mindful when populating these headers. Otherwise, the reqeust signature will be messed up. This change will ensure the protocol-specific default headers like content-type will be overriden by the serialized header if exists. For other headers added through middleware stack either by customization or users, it wouldn't affect signing or sending as long as the request doesn't contain same header names in different casing. All the internal headers will be consistent. But users should be careful when they are adding their own headers. We don't add middleware to lowercase all headers to prevent alternating the users' customizations. Ref: aws/aws-sdk-js-v3#1800
The HTTP request class doesn't have any implementations to insure case-insensitivity of the http headers. So we need to be mindful when populating these headers. Otherwise, the reqeust signature will be messed up. This change will ensure the protocol-specific default headers like content-type will be overriden by the serialized header if exists. For other headers added through middleware stack either by customization or users, it wouldn't affect signing or sending as long as the request doesn't contain same header names in different casing. All the internal headers will be consistent. But users should be careful when they are adding their own headers. We don't add middleware to lowercase all headers to prevent alternating the users' customizations. Ref: aws/aws-sdk-js-v3#1800
The HTTP request class doesn't have any implementations to insure case-insensitivity of the http headers. So we need to be mindful when populating these headers. Otherwise, the reqeust signature will be messed up. This change will ensure the protocol-specific default headers like content-type will be overriden by the serialized header if exists. For other headers added through middleware stack either by customization or users, it wouldn't affect signing or sending as long as the request doesn't contain same header names in different casing. All the internal headers will be consistent. But users should be careful when they are adding their own headers. We don't add middleware to lowercase all headers to prevent alternating the users' customizations. Ref: #1800
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
SignatureDoesNotMatch occures while uploading an object to S3 with ContentType.
SDK version number
@aws-sdk/[email protected]
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
To Reproduce (observed behavior)
Run following script
Got
Expected behavior
An object
s3://mybucketname/blah.json
is created with its Content-Type isapplication/json
.Additional context
With no
ContentType
, object is successfully created but its Content-Type isapplication/octet-stream
.The text was updated successfully, but these errors were encountered: