ProducesRequestCondition
saves the parsed Accept header in a request attribute, which is then cleared after all request mapping annotations are checked. We can do the same for ConsumesRequestCondition
, but only on the Spring MVC side since WebFlux uses ReadOnlyHttpHeaders
which already caches the Content-Type.
This was observed as part of investigations for #29421.
Comment From: rstoyanchev
On closer look, with 72119ac0 for #22644, we did consider ConsumesRequestCondition
but decided it's not necessary because of the cache in MimeTypeUtils
that saves common media types across requests. So nothing further to do here.