Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Stricter content-type header and request body check in higher versions of netty

3 views
Skip to first unread message

Ayaskant Swain

unread,
Apr 14, 2025, 8:06:38 AMApr 14
to Netty discussions
We upgraded our netty jar versions of below 2 artifacts in our application. Our application exposes REST APIs for another client app which calls them.
netty-codec-http
netty-common

And now our Regression test suite is failing for some flows after this change. We upgraded these two jar versions from version from 4.1.108.Final to 4.1.118.Final . upon debugging the failures what we found is that the de-serialization or decoding of the request payload at the server end failing if the content-type header in the incoming request does match with request body or payload that comes with it. for example if the content-type header is application/json but the body is plain text the it fails to deserialize. The issue was resolved after changing the content-type header to text/plain. Similarly this issue occurred in another flow where the content-type header value was application/x-www-form-urlencoded but the request body was in in json format. After changing the content-type header value to application/json the issues was resolved. 

Has there been any changes with respect to this in higher versions after 4.1.108 in netty and is there a way to disable this stricter check?

Thanks
Ayaskant
Reply all
Reply to author
Forward
0 new messages