When favorPathExtension is false ResourceHttpRequestHandler serves resources with different content type in 4.3 compared to 4.2 [SPR-14577] #19146
As a result of this change, when favoring of path extensions is disabled
I've attached a small Spring Boot application that reproduces the problem. It's configured to use Spring Framework 4.3.2 in order to reproduce the problem. Removing the override of the
With Spring Framework 4.3.2:
With Spring Framework 4.2:
Reference URL: spring-projects/spring-boot#6562
The text was updated successfully, but these errors were encountered:
Rossen Stoyanchev commented
Thanks for the example app.
Arguably the fix for #18233 went too far by falling back on any configured strategy in the ContentNegotiationManager and applications are exposed to idiosyncratic browser Accept headers. The issue is further exacerbated when the path extension strategy is turned off. What we really want is make use of registered file extension types (the original motivation of #18233), if any, or otherwise always check the file extension as was done in 4.2.x.