Make media type parsing strict #63080
Labels
:Core/Infra/REST API
REST infrastructure and utilities
>enhancement
Team:Core/Infra
Meta label for core/infra team
at the moment, we do not throw an explicit exception when an unsupported media type is used either in code or by users.
We should validate this when parsing and throw an explicit error to the user.
This will require changes across the codebase were we rely on parsing returning null and the logic is retrying parsing in a different way (a value from content-type or format parameter)
Also important to not allow java default accept header
"text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
which is sets bysun.net.www.protocol.http.HttpURLConnection
Make / parsing strict to return JSON
Unknown parameters for a known media type should also throw an exception
Validation of charset parameter should be enforced. Deprecation warnings for charset should be emitted in 7.x
comments #61427 (comment)
relates #61427
The text was updated successfully, but these errors were encountered: