The fix to protect against RFD exploits (#18124) introduced a "Content-Disposition:attachment;filename=f.txt" response header for @ResponseBody methods where the URL appears to have an extension that is neither whitelisted by default nor explicitly registered by the application.
By default ".html" is not whitelisted since a controller method returning String can be rendered as any requested content type (since StringHttpMessageConverter accepts "*/*") and in the case of HTML that can lead to XSS and RFD attacks.
However as commented under Spring Boot #4220 we should consider ways to make it straight-forward to render HTML via @ResponseBody when that is the actual intent.
While it's reasonable not to whitelist "html" by default (thus exposing controller methods returning String) we can also eliminate the need to explicitly register ".html" for content negotiation purposes. For example if the mapping includes ".html" or has a produces condition we shouldn't need anything further.
This now works so that any extension explicitly present in a request mapping is okay. Furthermore, specifically for ".html" in the URL we do allow suffix pattern matching if the method explicitly states that it produces "text/html".