Skip to content
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

ConsumesRequestCondition should cache the parsed Content-Type #29669

Closed
rstoyanchev opened this issue Dec 9, 2022 · 1 comment
Closed

ConsumesRequestCondition should cache the parsed Content-Type #29669

rstoyanchev opened this issue Dec 9, 2022 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@rstoyanchev
Copy link
Contributor

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.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Dec 9, 2022
@rstoyanchev rstoyanchev added this to the 6.0.3 milestone Dec 9, 2022
@rstoyanchev rstoyanchev self-assigned this Dec 9, 2022
@bclozel bclozel modified the milestones: 6.0.3, 6.0.x Dec 13, 2022
@rstoyanchev rstoyanchev modified the milestones: 6.0.x, 6.0.4 Dec 15, 2022
@rstoyanchev
Copy link
Contributor Author

On closer look, with 72119ac 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.

@rstoyanchev rstoyanchev closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
@rstoyanchev rstoyanchev removed this from the 6.0.4 milestone Jan 10, 2023
@rstoyanchev rstoyanchev added the status: declined A suggestion or change that we don't feel we should currently apply label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants