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

UnsupportedRequestContentTypeRejection formats error messages not in a user-friendly way #2804

satorg opened this issue Nov 6, 2019 · 3 comments


Copy link

@satorg satorg commented Nov 6, 2019

If a request is rejected with UnsupportedRequestContentTypeRejection and actual contentType is provided to the rejection, then the error message for this rejection will look like the following:

The request's Content-Type [Some(Some(image/gif))] is not supported. Expected:\nimage/jpeg or image/png

which is not user-friendly.

The reason is in these two lines:

The unsupportedContentType value has got type Option[Option[ContentType]].


This comment has been minimized.

Copy link

@raboof raboof commented Nov 7, 2019

That indeed could be better. Would you be interested in improving this?


This comment has been minimized.

Copy link
Contributor Author

@satorg satorg commented Nov 8, 2019

Yes, for sure. I have shot a tiny PR for this issue (#2807), could you take a look, please?

jrudolph added a commit that referenced this issue Nov 18, 2019
http: fix default rejection message for unsupported content type (#2804)
@jrudolph jrudolph added this to the 10.1.11 milestone Nov 18, 2019

This comment has been minimized.

Copy link

@jrudolph jrudolph commented Nov 18, 2019

Fixed in #2807.

@jrudolph jrudolph closed this Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.