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

SNS Publish is content type json when body isnt json #262

Open
rockliffelewis opened this issue Apr 25, 2023 · 1 comment
Open

SNS Publish is content type json when body isnt json #262

rockliffelewis opened this issue Apr 25, 2023 · 1 comment
Labels

Comments

@rockliffelewis
Copy link

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:

req.Header.Add("Content-Type", "application/json")

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.

@Admiral-Piett
Copy link
Owner

Good catch! I'll have a look at this as soon as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants