diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2016-11-20 18:43:37 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2016-11-21 23:56:17 +0300 |
commit | fcc78798121a0bd51265bb31eb051d1bb79ad9d3 (patch) | |
tree | 368613dc9a75b29a5d71eaf59be304959d5c6f38 | |
parent | d3e51b7f79f3098eb8a2f1a56c8f2a16db5eab6b (diff) | |
download | sproxy2-fcc78798121a0bd51265bb31eb051d1bb79ad9d3.tar.gz |
Remove some headers which are set automatically
By underlying HTTP Client or WAI
-rw-r--r-- | src/Sproxy/Application.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Sproxy/Application.hs b/src/Sproxy/Application.hs index 801212c..790b07c 100644 --- a/src/Sproxy/Application.hs +++ b/src/Sproxy/Application.hs @@ -28,8 +28,9 @@ import Data.Word8 (_colon) import Foreign.C.Types (CTime(..)) import Network.HTTP.Client.Conduit (bodyReaderSource) import Network.HTTP.Conduit (requestBodySourceChunkedIO, requestBodySourceIO) -import Network.HTTP.Types (RequestHeaders, ResponseHeaders, hConnection, - hContentLength, hContentType, hCookie, hLocation, methodGet) +import Network.HTTP.Types (RequestHeaders, ResponseHeaders, methodGet) +import Network.HTTP.Types.Header ( hConnection, + hContentLength, hContentType, hCookie, hLocation, hTransferEncoding ) import Network.HTTP.Types.Status ( Status(..), badRequest400, forbidden403, found302, internalServerError500, methodNotAllowed405, movedPermanently301, networkAuthenticationRequired511, notFound404, ok200, seeOther303, temporaryRedirect307 ) @@ -227,7 +228,8 @@ modifyRequestHeaders = filter (\(n, _) -> n `notElem` ban) ban = [ hConnection - , hContentLength -- XXX to avoid duplicate header + , hContentLength -- XXX This is set automtically before sending request to backend + , hTransferEncoding -- XXX Likewise ] modifyResponseHeaders :: ResponseHeaders -> ResponseHeaders @@ -236,6 +238,7 @@ modifyResponseHeaders = filter (\(n, _) -> n `notElem` ban) ban = [ hConnection + , hTransferEncoding -- XXX This is set automtically when sending respond from sproxy ] authenticationRequired :: ByteString -> HashMap Text OAuth2Client -> W.Application |