File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ private void sendHeaders() {
154154 try {
155155
156156 // Fallback
157- String contentType = getContentType ().getMIME () == null ? MediaType ._bin .getMIME () : getContentType ().getMIME ();
157+ String contentType = getContentType ().getExtension () == null ? MediaType ._bin .getExtension () : getContentType ().getMIME ();
158158
159159 // Set header and send response
160160 this .HEADER .set ("Content-Type" , contentType );
Original file line number Diff line number Diff line change @@ -695,8 +695,8 @@ public enum MediaType {
695695 private String MIME ;
696696 private String extension ;
697697
698- MediaType (String MIME , String extension ) {
699- this .MIME = MIME ;
698+ MediaType (String extension , String mime ) {
699+ this .MIME = mime ;
700700 this .extension = extension ;
701701 }
702702
Original file line number Diff line number Diff line change @@ -78,7 +78,11 @@ public static String getYourIp() throws UnknownHostException {
7878 */
7979 public static String getExtension (@ NotNull File file ) {
8080 String path = file .getAbsolutePath ();
81- return path .substring (path .lastIndexOf ('.' ));
81+ int indx = path .lastIndexOf ('.' ) + 1 ;
82+ if (indx == 0 )
83+ return null ;
84+
85+ return path .substring (indx );
8286 }
8387
8488}
You can’t perform that action at this time.
0 commit comments