Skip to content

Commit

Permalink
Deprecate WebApp#mimeTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jul 1, 2024
1 parent e323655 commit f56a275
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 1 addition & 5 deletions core/src/main/java/org/kohsuke/stapler/Stapler.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,7 @@ private String getMimeType(String fileName) {
idx = fileName.lastIndexOf('\\');
fileName = fileName.substring(idx + 1);

String extension = fileName.substring(fileName.lastIndexOf('.') + 1);
String mimeType = webApp.mimeTypes.get(extension);
if (mimeType == null) {
mimeType = getServletContext().getMimeType(fileName);
}
String mimeType = getServletContext().getMimeType(fileName);
if (mimeType == null) {
mimeType = "application/octet-stream";
}
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/org/kohsuke/stapler/WebApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ public static WebApp get(ServletContext context) {
*
* This overrides whatever mappings given in the servlet as far as stapler is concerned.
* This is case insensitive, and should be normalized to lower case.
*
* @deprecated removed without replacement
*/
@Deprecated
public final Map<String, String> mimeTypes = new Hashtable<>();

private volatile ClassLoader classLoader;
Expand Down

0 comments on commit f56a275

Please sign in to comment.