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

Handle unsupported request content type #3513

Merged
merged 4 commits into from
May 1, 2024
Merged

Conversation

raphael
Copy link
Member

@raphael raphael commented Apr 24, 2024

Return 415 Unsupported Media Type when the request decoder does not support the request content type.

Return 415 Unsupported Media Type when the request decoder does not support the request content type.
http/encoding.go Outdated Show resolved Hide resolved
http/error.go Show resolved Hide resolved
This makes it possible for the decoding code to return proper HTTP statuses depending on the name of error.
As of this PR, this is only used to return 415 "Unsupported Media Type" when an unsupported content type is used to encode the request payload.
@raphael raphael requested a review from tchssk April 29, 2024 21:37
Copy link
Member

@tchssk tchssk left a comment

Choose a reason for hiding this comment

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

LGTM!

@raphael raphael merged commit f11a242 into v3 May 1, 2024
11 checks passed
@raphael raphael deleted the feature/unsupported_media_type branch May 1, 2024 23:29
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.

None yet

2 participants