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 36c389d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions core/src/main/java/org/kohsuke/stapler/Stapler.java
Original file line number Diff line number Diff line change
Expand Up @@ -676,10 +676,7 @@ private String getMimeType(String fileName) {
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 36c389d

Please sign in to comment.