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

base64 encode SNS Header message attribure #1308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martinssipenko
Copy link

Fixes #1307

@martinssipenko
Copy link
Author

This solution would not work in cases where there are multiple distinct services using enqueue for cross-service communication via messages because this change would introduce bease64 encoding of messages, but if there are other services using an older version of this library, that can not base64 decode messages, the message consumption would break.

@@ -51,7 +51,7 @@ public function send(Destination $destination, Message $message): void
'MessageAttributes' => [
'Headers' => [
'DataType' => 'String',
'StringValue' => json_encode([$message->getHeaders(), $message->getProperties()]),
'StringValue' => base64_encode(json_encode([$message->getHeaders(), $message->getProperties()])),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can leave this without encoding base64 for now (keep changes not breaking).
In the next major release, we can add base64_encode part. 🤔

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.

Unescaped SNS MessageAttributes when message headers are used
2 participants