diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2016-11-22 00:14:20 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2016-11-22 00:14:20 +0300 |
commit | de113108b69b58adc4c9863b712aad3f08ccadac (patch) | |
tree | 074c50625e4198357ad22d005f19b5307b37596d | |
parent | fcc78798121a0bd51265bb31eb051d1bb79ad9d3 (diff) | |
download | sproxy2-de113108b69b58adc4c9863b712aad3f08ccadac.tar.gz |
Print original headers from backends
-rw-r--r-- | src/Sproxy/Application.hs | 6 |
1 files 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 |