-
Notifications
You must be signed in to change notification settings - Fork 164
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
Ignore Content-Type #182
Comments
Hi, I'm not sure this will fully answer your issue as i myself having occasional errors like that one but if you deactivate managed mode you should be able to handle whatever comes at you: I'm actually on some occasions having that exception even with managed mode deactivated but I'm only seeing that in production and am unable to reproduce it at the moment. |
Hi Laurent, sorry for the late reply. |
I have come across the same problem: rapidoid seems to parse the request body as JSON even though I only use |
Reverting to version 5.4.6 fixes this issue. It looks like the request body parsing was added in version 5.5.0. |
My goal is skip the build-in body parsing, and parse the body myself, always assuming a json body, ignoring the actual request Content-Type.
I already set a custom
jsonRequestBodyParser
and therefore skip the build-in parsing.However, I'm seeing exceptions in my logs when the Content-Type is empty or plain/text, or basically anything except
application/json
orapplication/xml
:which originates in
ReqImpl.java
:I tried to have an interceptor overriding the Content-Type (Kotlin code), but to no success, as the interceptor is only run after the body parsing:
Any way I can achieve ignoring the Content-Type and not throwing the exception?
The API still works and is functional, but I can't deploy anything that throws exceptions eventually.
Thank you for your help and the great work on this project!
The text was updated successfully, but these errors were encountered: