-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
Daniel Fernández opened SPR-14999 and commented
Scenario
A web application using Spring 5.0.0.BUILD-SNAPSHOT, Spring Boot 2.0.0.BUILD-SNAPSHOT and Spring Web Reactive does server-side rendering and needs to serve static resources, such as images and CSS style sheet files.
Server is Tomcat (though it seems to affect all servers, or at least several).
Observed Results
All static resources: images, CSSs, etc, are being served with Content-Type: application/octet-stream. This causes e.g. CSS style sheets not to be rendered by browsers:
See the returned headers, using httpie:
$ http http://localhost:8080/css/stsm.css
HTTP/1.1 200
Accept-Ranges: bytes
Cache-Control: max-age=0
Content-Length: 2518
Content-Type: application/octet-stream
Date: Thu, 08 Dec 2016 23:42:12 GMT
Last-Modified: Thu, 08 Dec 2016 23:24:46 GMT
(content follows)...
Example Repository
I'm creating a Spring Web Reactive-enabled version of Thymeleaf's STSM example application at the thymeleaf/thymeleafexamples-stsm-reactive repository on GitHub: https://github.com/thymeleaf/thymeleafexamples-stsm-reactive/tree/SPR-14999 (tag: SPR-14999)
It can be executed with mvn -U clean compile spring-boot:run. The URL shown above (http://localhost:8080/css/stsm.css) can be used for testing this issue.
Affects: 5.0 M3
Reference URL: https://github.com/thymeleaf/thymeleafexamples-stsm-reactive/tree/SPR-14999
Issue Links:
- MediaTypeFactory should come with its own complete mime.types file [SPR-14908] #19474 MediaTypeFactory should come with its own complete mime.types file ("is superseded by")