Skip to content

Commit

Permalink
return correct mime type for js and css
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Jan 31, 2023
1 parent c39f8eb commit b8b6753
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ public String getMimeType(String s) {
if (mimeTypes == null) {
mimeTypes = new MimetypesFileTypeMap();
}
if (s.endsWith(".js")) {
return "application/javascript";
}
if (s.endsWith(".css")) {
return "text/css";
}
// TODO: The getContentType method of the MimetypesFileTypeMap returns application/octet-stream
// instead of null when the type cannot be found. We should replace with an implementation that
// loads the System mime types ($JAVA_HOME/lib/mime.types
Expand Down

0 comments on commit b8b6753

Please sign in to comment.