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

fix: properly calculate content-length for cfn custom resource responses #3584

Merged

Conversation

auvred
Copy link
Contributor

@auvred auvred commented Dec 13, 2023

Ref: aws/aws-cdk#24501

Custom Resources need to write their response into a S3 object.
This is implemented as a PUT request to a pre-signed URL and has to specify the content-length of the response object.
Previously the CustomResource code would use responseBody.length.
However this returns the number of graphemes, not bytes.
If any utf8 characters with graphemes != bytes are part of the response, CloudFormation would fail the deployment with a Response is not valid JSON error.

Copy link

changeset-bot bot commented Dec 13, 2023

🦋 Changeset detected

Latest commit: f1d7b9a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
sst Patch
@sst/console Patch
create-sst Patch
astro-sst Patch
svelte-kit-sst Patch
solid-start-sst Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jayair
Copy link
Contributor

jayair commented Dec 16, 2023

Oh interesting. Let me ask the team to take a look.

@fwang fwang merged commit 5201a37 into sst:master Jan 10, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Jan 10, 2024
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.

None yet

3 participants