spring-projects / spring-projects/spring-framework

Allow defining custom file extension to media type mappings in ResourceHttpMessageConverter [SPR-14409]

Open
#18,980 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: web type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Oliver Drotbohm opened SPR-14409 and commented

ResourceHttpMessageConverter currently uses the mime.types mapping file contained in org/springframework/mail/javamail to control which file extension is mapped to which media type.

It would be cool if there was an easy way to register additional mappings on the converter itself that would take precedence over the automated lookup via JAF. That way, Spring Boot could expose those additional mappings through application.properties.


Affects: 4.3 GA

Issue Links:

  • #18985 Rendering of a Resource should try to derive the served media type

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ResourceHttpMessageConverter and its use of the org/springframework/mail/javamail/mime.types mapping file and JAF lookup. Determine the converter-level registration behavior and precedence required for additional extension-to-media-type mappings; done means custom mappings are accepted and override automated lookup.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.