-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
SNS: implement Content-Type logic for http/https target #11634
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
Conversation
"Accept-Encoding": "gzip,deflate", | ||
"Connection": "connection", | ||
"Content-Length": "content--length", | ||
"Content-Type": "application/json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the important part of the fix: properly received content-type
"Accept-Encoding": "gzip,deflate", | ||
"Connection": "connection", | ||
"Content-Length": "content--length", | ||
"Content-Type": "text/plain; charset=UTF-8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shows that the SubscriptionConfirmation
ignores the configured content-type
"Accept-Encoding": "gzip,deflate", | ||
"Connection": "connection", | ||
"Content-Length": "content--length", | ||
"Content-Type": "text/csv", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, shows the fix
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 1h 1m 34s ⏱️ - 38m 25s Results for commit b28ca9a. ± Comparison against base commit 50b4063. This pull request removes 1375 and adds 3 tests. Note that renamed tests count towards both.
This pull request removes 214 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Nice fix. The testing is really great. Good attention to details to implement both subscription attributes and topic atributes!
Motivation
As reported with #11617, we did not properly use the configured Content-Type when sending
Notification
message type.I've tried to implement some CRUD validation around
Topic
attributes, but it needs a lot of it, and everything lives in moto. Either we move away from it as most of it is mocked only and implement it in LocalStack, or we need to implement the feature there.The fix/feature implemented here should be pretty solid, the only issue is that we can accept any format and users might not understand straight away why it doesn't work when the
DeliveryPolicy
they passed would fail when trying to set it, against AWS.This page explains it pretty well: https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html#creating-delivery-policy
Changes
http
andhttps
targets, properly fetch the configuredContent-Type
to send.fixes #11617