@@ -44,6 +44,7 @@ import Network.Wai.Internal (Response (ResponseRaw))
44import Data.Default.Class (Default (def))
44import Data.Default.Class (Default (def))
45import Network.Wai.Logger
45import Network.Wai.Logger
46import Network.Wai.Middleware.RequestLogger.Internal
46import Network.Wai.Middleware.RequestLogger.Internal
47+import Data.Text.Encoding (decodeUtf8')
48data OutputFormat = Apache IPAddrSource
49data OutputFormat = Apache IPAddrSource
49 | Detailed Bool -- ^ use colors?
50 | Detailed Bool -- ^ use colors?
@@ -222,7 +223,8 @@ detailedMiddleware' cb ansiColor ansiMethod ansiStatusCode app req sendResponse
222 return (req', body)
223 return (req', body)
223 _ -> return (req, [])
224 _ -> return (req, [])
225− let reqbody = if null body then [""] else ansiColor White " Request Body: " <> body <> ["\n"]
226+ let reqbodylog _ = if null body then [""] else ansiColor White " Request Body: " <> body <> ["\n"]
227+ reqbody = concatMap (either (const [""]) reqbodylog . decodeUtf8') body
226 postParams <- if requestMethod req `elem` ["GET", "HEAD"]
228 postParams <- if requestMethod req `elem` ["GET", "HEAD"]
227 then return []
229 then return []
228 else do postParams <- liftIO $ allPostParams body
230 else do postParams <- liftIO $ allPostParams body