Skip to content

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

Closed

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

Activity

  1. spring-projects-issues commented on Dec 9, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Rossen Stoyanchev commented

    Having mime.types for use with spring-web is quite critical with the reactive support where we cannot fall back on ServletContext media type lookups. As it is right now serving css files does not work out of the box (see #19566).

  2. spring-projects-issues commented on Mar 14, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Arjen Poutsma commented

    PR at #1356

  3. spring-projects-issues commented on Mar 21, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Rossen Stoyanchev commented

    PR processed with some follow-up comments.

  4. spring-projects-issues commented on Mar 23, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Arjen Poutsma commented

    Further commits related to this issue in fd1db57 and a287e67

  5. added
    in: web
    type: task
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: task

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions