Skip to content

Commit

Permalink
Make it work with new http-client and http-conduit
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Jul 6, 2016
1 parent 2f70d8f commit ad2f368
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion Network/HTTP/Proxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ doUpstreamRequest settings mgr respond mwreq
Wai.KnownLength l ->
HC.requestBodySourceIO (fromIntegral l) (sourceRequestBody mwreq)
, HC.decompress = const True
, HC.checkStatus = \_ _ _ -> Nothing
}
handle (respond . errorResponse) $
HC.withResponse hreq mgr $ \res -> do
Expand Down
3 changes: 0 additions & 3 deletions Test/Request.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ mkTestRequest method scheme path mbody = do
return $ req
{ HC.method = if HC.method req /= method then method else HC.method req
, HC.requestBody = fromMaybe (HC.requestBody req) mbody
-- In this test program we want to pass error pages back to the test
-- function so the error output can be compared.
, HC.checkStatus = \ _ _ _ -> Nothing
}


Expand Down
2 changes: 1 addition & 1 deletion Test/testsuite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ requestTest = describe "Request:" $ do
-- Getting a TlsException shows that we have successfully upgraded
-- from HTTP to HTTPS. Its not possible to ignore this failure
-- because its made by the http-conduit inside the proxy.
BS.take 12 (resultBS result) `shouldBe` "TlsException"
BS.take 13 (resultBS result) `shouldBe` "HttpException"
it "Can provide a proxy Response." $
withTestProxy proxySettingsProxyResponse $ \ testProxyPort -> do
req <- addTestProxy testProxyPort <$> mkGetRequest Http "/whatever"
Expand Down
4 changes: 2 additions & 2 deletions http-proxy.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Library
, case-insensitive >= 1.2
, conduit >= 1.2
, conduit-extra >= 1.1
, http-client >= 0.4 && < 0.5
, http-conduit >= 2.1.7 && < 2.2
, http-client >= 0.5 && < 0.6
, http-conduit >= 2.2 && < 2.3
, http-types >= 0.8
, mtl >= 2.1
, network >= 2.6
Expand Down

0 comments on commit ad2f368

Please sign in to comment.