Skip to content

fix: do not assume an empty content-type header is JSON #444

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

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

lance
Copy link
Member

@lance lance commented Nov 19, 2021

The parser for HTTP binary made the assumption that if there was no content-type
header in the incoming message, it should inject application/json. Discussion
about the rationale for this is in #441.

This commit removes that injection and adds a test to ensure the bytes are not parsed, but just passed along untouched.

Fixes: #441

Signed-off-by: Lance Ball [email protected]

The parser for HTTP binary made the assumption that if there was no `content-type`
header in the incoming message, it should inject `application/json`. Discussion
about the rationale for this is in cloudevents#441.

This commit, removes that injection and adds a test to ensure the bytes are
simply not parsed, but just passed along untouched.

Fixes: cloudevents#441

Signed-off-by: Lance Ball <[email protected]>
@lance lance added the type/fix A change that fixes something that is broken label Nov 19, 2021
@lance lance requested a review from a team November 19, 2021 17:13
@lance lance self-assigned this Nov 19, 2021
@lance
Copy link
Member Author

lance commented Nov 24, 2021

@grant or @lholmquist would one of you ptal 😺

@lance lance merged commit 52ea7de into cloudevents:main Nov 24, 2021
@lance lance deleted the lance/441-dont-parse-ambiguous-data branch November 24, 2021 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix A change that fixes something that is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CloudEvent with no datacontenttype parsed as JSON instead of plain text
2 participants