-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Craig Walls opened SPR-7929 and commented
MappingJacksonJsonConverter has a setSupportedMediaTypes() method, which kinda makes sense for JSON messages, since there may not be much agreement on a JSON content type (Facebook, BTW, sends back JSON responses as "text/javascript").
FormHttpMessageConverter, on the other hand, has no such method. It is limited to supporting "application/www-form-url-encoded", which makes sense on the surface, as who would ever send url-encoded data with any other content type?
Except that Facebook's OAuth API sends back access token data in URL-encoded form, but with Content-Type set to "text/plain". Even though FormHttpMessageConverter is capable of converting the message, it won't because it doesn't support "text/plain".
For these special cases when APIs don't adhere to content types that are consistent with the response data, it'd be helpful for FormHttpMessageConverter to have a setSupportedMediaTypes() just as MappingJacksonJsonConverter has.
No further details from SPR-7929