MIMETypes.st
changeset 1273 7a52d4bcdb10
parent 1272 91ba4078b690
child 1274 4b7fe76f7243
--- a/MIMETypes.st	Wed Dec 01 11:19:43 1999 +0100
+++ b/MIMETypes.st	Wed Dec 01 11:21:29 1999 +0100
@@ -328,7 +328,7 @@
 mimeTypeForFilename:filename
     "given a filename, return the mime-type or nil, if unknown"
 
-    |type lcFilename|
+    |type lcFilename suff|
 
     lcFilename := filename asFilename name asLowercase.
     type := FilenameToTypeMapping at:lcFilename ifAbsent:nil.
@@ -339,13 +339,6 @@
         "/ this avoids constant retry if a mimeType is not known in
         "/ the OS.
         type isNil ifTrue:[
-            (#('make.proto'
-               'makefile'
-            ) includes:lcFilename) ifTrue:[
-                type := 'application/x-make'
-            ].
-        ].
-        type isNil ifTrue:[
             FilenameToTypeMapping at:lcFilename put:#unknown
         ].
     ].
@@ -353,8 +346,15 @@
     type == #unknown ifTrue:[
         type := nil.
     ].
+
+    type isNil ifTrue:[
+        suff := filename asFilename suffix.
+        suff size ~~ 0 ifTrue:[
+            ^ self mimeTypeForSuffix:suff
+        ]
+    ].
+
     ^ type
-
 !
 
 mimeTypeForFilename:filename put:mimeType
@@ -408,6 +408,6 @@
 !MIMETypes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.19 1999-12-01 10:19:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/MIMETypes.st,v 1.20 1999-12-01 10:21:29 cg Exp $'
 ! !
 MIMETypes initialize!