Buffering output

This commit is contained in:
Michael Snoyman 2010-05-01 22:38:30 +03:00
parent 22ef236fef
commit de7ed94abd
2 changed files with 4 additions and 2 deletions

View File

@ -21,6 +21,7 @@ import Web.Routes.Quasi
import Language.Haskell.TH.Syntax
import qualified Network.Wai as W
import qualified Network.Wai.Enumerator as W
import Network.Wai.Middleware.CleanPath
import Network.Wai.Middleware.ClientSession
import Network.Wai.Middleware.Jsonp
@ -220,7 +221,8 @@ responseToWaiResponse (sc, hs, ct, c) = do
let hs'' = (W.ContentType, cs $ contentTypeToString ct) : hs'
return $ W.Response sc hs'' $ case c of
ContentFile fp -> Left fp
ContentEnum e -> Right $ W.Enumerator e
ContentEnum e -> Right $ W.buffer
$ W.Enumerator e
-- | Convert Header to a key/value pair.
headerToPair :: Header -> IO (W.ResponseHeader, B.ByteString)

View File

@ -40,7 +40,7 @@ library
Buildable: True
build-depends: base >= 4 && < 5,
time >= 1.1.3 && < 1.2,
wai >= 0.0.0 && < 0.3,
wai >= 0.0.1 && < 0.3,
wai-extra >= 0.0.0 && < 0.1,
authenticate >= 0.6 && < 0.7,
bytestring >= 0.9.1.4 && < 0.10,