I have Spring MVC application and I am trying to upgrade Spring Boot from 3.3.5 to 3.4.0.

For integration tests, I use some static resources. I put them in /src/intTest/resources/static and Spring automatically serves them.

The issue is that when I send HEAD request for a static resource, the response does not contain Content-Length header. In 3.3.5, the header was present.

Steps to reproduce: 1. Add testimage.png file to /src/main/resources/static folder 2. Use curl: curl -v -I 'http://localhost:8080/testimage.png' 3. Check that Content-Length header is missing in 3.4.0.

From what I debugged 3.4.0, the content length is computed but not sent for some reason. Please see screenshot for ResourceHttpRequestHandler in 3.4.0: 3_4_0

Comment From: bclozel

Duplicates #43272