Since some users seem to insert content with extensions like .HTM, and
.JPG we might as well recognise these variations. Here's a patch that
falls back on lower-casing the extension if it didn't match on the
first try:

Index: MimeTypeUtils.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/metadata/MimeTypeUtils.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 MimeTypeUtils.java
--- MimeTypeUtils.java	13 Jan 2002 05:24:21 -0000	1.1.1.1
+++ MimeTypeUtils.java	1 Sep 2002 20:42:12 -0000
@@ -197,7 +197,10 @@
 	if (extension == null) {
 	    return null;
 	} else {
-	    return (String) typeMap.get(extension);
+	    if (typeMap.get(extension) != null)
+		return (String) typeMap.get(extension);
+	    else
+		return (String) typeMap.get(extension.toLowerCase());
 	}
     }
 

-- 
Robbe

Attachment: signature.ng
Description: PGP signature

Reply via email to