]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/StaticFile.hs
Many bugfixes
[Lucu.git] / Network / HTTP / Lucu / StaticFile.hs
index 82bc59b84db9706a688e1b69ab215a7bdfee1d51..4f669314aee7e599703e999433a63713fe1b4a6f 100644 (file)
@@ -46,21 +46,24 @@ staticFile path
       }
 
 octetStream ∷ MIMEType
-octetStream = mkMIMEType "application" "octet-stream"
+{-# NOINLINE octetStream #-}
+octetStream = parseMIMEType "application/octet-stream"
 
 handleStaticFile ∷ Bool → FilePath → Resource ()
 handleStaticFile sendContent path
     = do exists ← liftIO $ fileExist path
          unless exists
-             $ foundNoEntity Nothing
+             foundNoEntity'
 
          readable ← liftIO $ fileAccess path True False False
          unless readable
-             $ abort Forbidden [] Nothing
+             $ abort
+             $ mkAbortion Forbidden [] Nothing
 
          stat ← liftIO $ getFileStatus path
          when (isDirectory stat)
-             $ abort Forbidden [] Nothing
+             $ abort
+             $ mkAbortion Forbidden [] Nothing
 
          tag  ← liftIO $ generateETagFromFile path
          let lastMod = posixSecondsToUTCTime