You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(custom-resource): custom resources fail with data containing multi-byte utf8 chars (#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.
Also updates the `log-retention-provider` code, although the data should only contain 1-byte characters. Due to this limitation it can't be tested.
Closes#24491
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy file name to clipboardExpand all lines: packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/asset.8c980c60f4c1c0edebd987e6043e356b8d439b2d731c5af3329df082ca5a6a79/index.js
Copy file name to clipboardExpand all lines: packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.js.snapshot/aws-cdk-sdk-js.assets.json
0 commit comments