Skip to content

HttpEntity.EMPTY headers should not be possible to mutate via HttpHeaders constructor #34812

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

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Apr 24, 2025

Fix GH-34806

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 24, 2025
@rstoyanchev rstoyanchev self-assigned this Apr 28, 2025
@rstoyanchev rstoyanchev added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Apr 28, 2025
Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should remove the unwrapping in the HttpHeaders constructor, which is an optimization. HttpHeaders already supports an EMPTY instance, and we can update the creation of HttpEntity.EMPTY to use it.

@quaff
Copy link
Contributor Author

quaff commented Apr 28, 2025

I don't think we should remove the unwrapping in the HttpHeaders constructor, which is an optimization. HttpHeaders already supports an EMPTY instance, and we can update the creation of HttpEntity.EMPTY to use it.

Updated as you suggested.

@rstoyanchev rstoyanchev added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 28, 2025
@rstoyanchev rstoyanchev added this to the 6.2.7 milestone Apr 28, 2025
@rstoyanchev rstoyanchev changed the title HttpEntity.EMPTY should be immutable HttpEntity.EMPTY headers should not be possible to mutate via HttpHeaders constructor Apr 28, 2025
rstoyanchev pushed a commit that referenced this pull request Apr 28, 2025
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) type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpEntity.EMPTY may reference mutable headers
3 participants