From de113108b69b58adc4c9863b712aad3f08ccadac Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 22 Nov 2016 00:14:20 +0300 Subject: Print original headers from backends --- src/Sproxy/Application.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sproxy/Application.hs b/src/Sproxy/Application.hs index 790b07c..5ce847c 100644 --- a/src/Sproxy/Application.hs +++ b/src/Sproxy/Application.hs @@ -214,12 +214,12 @@ forward mgr req resp = do Log.debug $ "BACKEND <<< " ++ msg ++ " " ++ show (BE.requestHeaders beReq) BE.withResponse beReq mgr $ \res -> do let status = BE.responseStatus res - headers = modifyResponseHeaders $ BE.responseHeaders res + headers = BE.responseHeaders res body = mapOutput (Chunk . fromByteString) . bodyReaderSource $ BE.responseBody res logging = if statusCode status `elem` [ 400, 500 ] then Log.warn else Log.debug - logging $ "BACKEND >>> " ++ show (statusCode status) ++ " on " ++ msg ++ "\n" - resp $ responseSource status headers body + logging $ "BACKEND >>> " ++ show (statusCode status) ++ " on " ++ msg ++ " " ++ show headers ++ "\n" + resp $ responseSource status (modifyResponseHeaders headers) body modifyRequestHeaders :: RequestHeaders -> RequestHeaders -- cgit v1.2.3