We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0216d09 commit 1504faeCopy full SHA for 1504fae
src/express/ExpressUtils.java
@@ -1,5 +1,7 @@
1
package express;
2
3
+import express.utils.MIMETypes;
4
+
5
import java.io.*;
6
7
public class ExpressUtils {
@@ -35,11 +37,12 @@ public static String streamToString(InputStream is) {
35
37
*/
36
38
public static String getContentType(File file) {
39
String filename = file.getAbsolutePath().replaceAll("^(.*\\.|.*\\|.+$)", "");
40
+ String contentType = MIMETypes.get().get(filename);
41
- if (filename == null)
- filename = "text/plain";
42
+ if (contentType == null)
43
+ contentType = "text/plain";
44
- return filename;
45
+ return contentType;
46
}
47
48
0 commit comments