@@ -44,6 +44,7 @@ import Network.Wai.Internal (Response (ResponseRaw))
4444import Data.Default.Class (Default (def))
4545import Network.Wai.Logger
4646import Network.Wai.Middleware.RequestLogger.Internal
47+import Data.Text.Encoding (decodeUtf8')
4748
4849data OutputFormat = Apache IPAddrSource
4950 | Detailed Bool -- ^ use colors?
@@ -222,7 +223,8 @@ detailedMiddleware' cb ansiColor ansiMethod ansiStatusCode app req sendResponse
222223 return (req', body)
223224 _ -> return (req, [])
224225
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
226228 postParams <- if requestMethod req `elem` ["GET", "HEAD"]
227229 then return []
228230 else do postParams <- liftIO $ allPostParams body