goaws
goaws copied to clipboard
SNS Publish is content type json when body isnt json
I've got an SNS topic publishing to a HTTP endpoint, and the response its giving me has header Content-Type: application/json
but the body isnt valid JSON.
The AWS documentation states that the header should be text/plain
: https://docs.aws.amazon.com/sns/latest/dg/sns-message-and-json-formats.html
Changing this to suit would fix my issue at least: https://github.com/Admiral-Piett/goaws/blob/bc027e4ec99c700f0935c75c9a57f6cc21157cb2/app/gosns/gosns.go#L642
Currently its difficult to process the request using nodejs express, as the body parsers use that content type to decide how to parse the body, and the bodys json content is formatted a bit weirdly.
Good catch! I'll have a look at this as soon as I can.