Skip to content

MediaTypeFactory should come with its own complete mime.types file [SPR-14908] #19474

@spring-projects-issues

Description

@spring-projects-issues

Arjen Poutsma opened SPR-14908 and commented

A couple of improvements to MediaTypeFactory, in order to improve the experience of serving Resource instances from web apps:

  • Copy (or move) the mime.types file from context-support to the factory module. context-support is not necessarily included on the classpath, and is quite vital since the default mime types file provided by JAF is not satisfactory (see below)
  • Add additional file types to the mime.types file. It has does not reflect current web media types (such as woff, woff2, ico)

Optionally:

  • -Rename it to MimeTypeFactory and move it to the core module, next to MimeType (or possibly merge it into MimeType). Determining the mime type of a file is not necessarily only a concern for web apps.-
  • Drop the Java Activation dependency, as we don't really need it: the mimetypes.default file provided in the JDK brings us even less than our own mime.types, and in JDK 9 we cannot assume that JAF is always present.

Issue Links:

1 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions