Details
-
Bug
-
Resolution: Fixed
-
Low
-
2.7.6
-
None
-
None
Description
the line "foo/bar name" in raw-mime.types maps the foo/bar mime type to files named *.name and files named <any single character>name, e.g. 1name, 2name, xname etc.
See CustomFileNameMap where idx is set to zero when it should be left at -1.
public String getContentTypeFor(String fileName) { int idx = fileName.lastIndexOf('.'); if (idx == -1) { idx = 0; } if (fileName.length() == idx) { return null; } String ext = fileName.substring(idx + 1); //BUG: when idx is zero we strip one character from the name return mMapping.get(ext); }