Skip to content

Conversation

joakime
Copy link
Contributor

@joakime joakime commented Jul 22, 2025

Introduce new MimeTypes.Mutable.clear() method.

Closes #13366

@joakime joakime requested a review from sbordet July 22, 2025 12:36
@joakime joakime self-assigned this Jul 22, 2025
@joakime joakime added Enhancement Third Party Issues with third party libraries or projects labels Jul 22, 2025
@joakime joakime moved this to 👀 In review in Jetty 12.1.0 - (FROZEN) Jul 22, 2025
@joakime joakime linked an issue Jul 22, 2025 that may be closed by this pull request
Comment on lines +175 to +185
// Set a few new values
webappMimeTypes.addMimeMapping("html", "text/html");
// HTML is inferred to be UTF-8, and will always have a 'charset' on the content-type header
webappMimeTypes.addInferred("text/html", "utf-8");

webappMimeTypes.addMimeMapping("json", "application/json");
// JSON is always UTF-8, and is never represented as a 'charset' on the content-type header
webappMimeTypes.addAssumed("application/json", "utf-8");

// Images never have a 'charset' on the content-type field
webappMimeTypes.addAssumed("image/*", null);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly using theses as examples on how to set up the MimeTypes object properly.

@joakime
Copy link
Contributor Author

joakime commented Jul 22, 2025

@sbordet should we backport this change to 12.0.x also?

@joakime joakime merged commit ca921d1 into jetty-12.1.x Jul 24, 2025
10 checks passed
@joakime joakime deleted the fix/12.1.x/mimetypes-mutable-clear branch July 24, 2025 09:54
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Jetty 12.1.0 - (FROZEN) Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Third Party Issues with third party libraries or projects
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Introduce MimeTypes.Mutable.clear() API
2 participants