Permalink
Browse files

servius uses mime-types

  • Loading branch information...
1 parent fb45b4f commit a68711af2b3f0ced1144a26c9dffdb173190612d @snoyberg snoyberg committed Jul 10, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −0 servius/servius.cabal
  2. +3 −3 servius/servius.hs
View
1 servius/servius.cabal
@@ -30,6 +30,7 @@ Executable servius
, shakespeare-css >= 1.0 && < 1.1
, transformers
, wai >= 1.3 && < 1.4
+ , mime-types >= 0.1 && < 0.2
source-repository head
type: git
View
6 servius/servius.hs
@@ -25,8 +25,8 @@ import Network.HTTP.Types (status200)
import Text.Blaze.Html.Renderer.Utf8 (renderHtmlBuilder)
import qualified Data.Text.Lazy as TL
import Blaze.ByteString.Builder.Char.Utf8 (fromLazyText)
-import WaiAppStatic.Mime (defaultMimeMap, mimeByExt, defaultMimeType)
-import WaiAppStatic.Types (ssIndices, toPiece, ssGetMimeType, fileName)
+import Network.Mime (defaultMimeMap, mimeByExt, defaultMimeType)
+import WaiAppStatic.Types (ssIndices, toPiece, ssGetMimeType, fileName, fromPiece)
import Data.String (fromString)
import Data.Maybe (mapMaybe)
@@ -57,7 +57,7 @@ main = do
. shake docroot
run port $ middle $ staticApp (defaultFileServerSettings $ fromString docroot)
{ ssIndices = if noindex then [] else mapMaybe (toPiece . pack) index
- , ssGetMimeType = return . mimeByExt mimeMap defaultMimeType . fileName
+ , ssGetMimeType = return . mimeByExt mimeMap defaultMimeType . fromPiece . fileName
}
shake :: FilePath -> Middleware

0 comments on commit a68711a

Please sign in to comment.