module WASH.CGI.ContentType where
import Char
import List
guessContentType :: String -> String
guessContentType name = g (map toLower name)
where
g name
| ".eps" `isSuffixOf` name = "application/postscript"
| ".ps" `isSuffixOf` name = "application/postscript"
| ".ps.gz" `isSuffixOf` name = "application/postscript"
| ".pdf" `isSuffixOf` name = "application/pdf"
| ".html" `isSuffixOf` name = "text/html"
| ".gif" `isSuffixOf` name = "image/gif"
| ".png" `isSuffixOf` name = "image/png"
| ".jpg" `isSuffixOf` name = "image/jpeg"
| otherwise = "application/octet-stream"