@@ -39,6 +39,7 @@ import Web.Encodings.StringLike (StringLike)
3939import qualified Web.Encodings.StringLike as SL
4040
4141import qualified Safe
42+import Network.Socket.SendFile
4243
4344run :: Port -> Application -> IO ()
4445run port = withSocketsDo .
@@ -162,7 +163,7 @@ sendResponse h res = do
162163 mapM_ putHeader $ headers res
163164 BS.hPut h $ SL.pack "\r\n"
164165 case body res of
165− Left fp -> BL.readFile fp >>= BL.hPut h
166+ Left fp -> unsafeSendFile h fp
166167 Right enum -> enum $ BS.hPut h
167168 where
168169 putHeader (x, y) = do