Skip to content

Commit

Permalink
Fix mimetypes on attachments as some were incorrect.
Browse files Browse the repository at this point in the history
i.e. it could produce the following invalid mime types - text/txt, image/jpg, image/tif
Also added htm to the list so that it would not produce application/htm
  • Loading branch information
ianwallen committed Jan 29, 2024
1 parent 59762eb commit ea589b3
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,22 @@ public static String getFileContentType(Path file) throws IOException {
case "png":
case "gif":
case "bmp":
contentType = "image/" + ext;
break;
case "tif":
case "tiff":
contentType = "image/tiff";
break;
case "jpg":
case "jpeg":
contentType = "image/" + ext;
contentType = "image/jpeg";
break;
case "txt":
contentType = "text/plain";
break;
case "htm":
case "html":
contentType = "text/" + ext;
contentType = "text/html";
break;
default:
contentType = "application/" + ext;
Expand Down

0 comments on commit ea589b3

Please sign in to comment.