From 465188e1668b77c4610fc178ba88837675c900da Mon Sep 17 00:00:00 2001 From: Snoyman Date: Thu, 4 Mar 2010 04:37:58 -0800 Subject: [PATCH] Switched to parseRequestBody in web-encodings --- Yesod/Request.hs | 14 +++----------- yesod.cabal | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Yesod/Request.hs b/Yesod/Request.hs index 60abcb25..0d925f9f 100644 --- a/Yesod/Request.hs +++ b/Yesod/Request.hs @@ -38,7 +38,6 @@ module Yesod.Request ) where import qualified Network.Wai as W -import qualified Network.Wai.Source as WS import Data.Function.Predicate (equals) import Yesod.Definitions import Web.Encodings @@ -137,16 +136,9 @@ parseWaiRequest env session = do return $ RawRequest gets' cookies' session rbthunk env langs'' rbHelper :: W.Request -> IO RequestBodyContents -rbHelper env = do - inputLBS <- WS.toLBS $ W.requestBody env -- FIXME - let clength = maybe "0" cs $ lookup W.ReqContentLength - $ W.requestHeaders env - let ctype = maybe "" cs $ lookup W.ReqContentType $ W.requestHeaders env - let convertFileInfo (FileInfo a b c) = FileInfo (cs a) (cs b) c - let ret = map (cs *** cs) *** - map (cs *** convertFileInfo) - $ parsePost ctype clength inputLBS - return ret +rbHelper = fmap (fix1 *** map fix2) . parseRequestBody lbsSink where + fix1 = map (cs *** cs) + fix2 (x, FileInfo a b c) = (cs x, FileInfo (cs a) (cs b) c) #if TEST testSuite :: Test diff --git a/yesod.cabal b/yesod.cabal index be9949e3..d155f460 100644 --- a/yesod.cabal +++ b/yesod.cabal @@ -38,7 +38,7 @@ library authenticate >= 0.4.0 && < 0.5, predicates >= 0.1 && < 0.2, bytestring >= 0.9.1.4 && < 0.10, - web-encodings >= 0.2.3 && < 0.3, + web-encodings >= 0.4.0 && < 0.5, data-object >= 0.2.0 && < 0.3, data-object-yaml >= 0.2.0 && < 0.3, directory >= 1 && < 1.1,