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

Content-Length Header Filtered for HEAD Requests in Spring Boot 3.3.6 or 3.4.0 #43576

Closed
TheryCN opened this issue Dec 19, 2024 · 1 comment
Closed
Labels
status: duplicate A duplicate of another issue

Comments

@TheryCN
Copy link

TheryCN commented Dec 19, 2024

Hi,

When migrating from Spring Boot 3.3.5 to 3.3.6 (or 3.4.0), it seems that the Content-Length is filtered on every HEAD requests.

Here is a minimal example that demonstrates the issue:

@RestController
public class AnyController {

	@RequestMapping(method = RequestMethod.HEAD)
	public ResponseEntity<Void> getAnyHeader() {
		return ResponseEntity.ok().headers(httpHeaders -> httpHeaders.setContentLength(50L)).build();
	}

}

I found a related issue reported on Stack Overflow: Content-Length Header is Removed from HEAD Response.
Thanks for your help!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 19, 2024
@wilkinsona
Copy link
Member

Duplicates #43272.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants