From ec5960ab119bc821f3dc6589c48c1a88c6bb1bac Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 21 Jul 2015 16:32:44 -0700 Subject: Use newManager instead of withManager in recent http-client. This avoids a deprecation warning. --- src/Text/Pandoc/Shared.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index ef9f66aa7..edf2619c0 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -142,9 +142,14 @@ import Text.Pandoc.Data (dataFiles) import Paths_pandoc (getDataFileName) #endif #ifdef HTTP_CLIENT -import Network.HTTP.Client (httpLbs, parseUrl, withManager, +import Network.HTTP.Client (httpLbs, parseUrl, responseBody, responseHeaders, Request(port,host)) +#if MIN_VERSION_http_client(0,4,18) +import Network.HTTP.Client (newManager) +#else +import Network.HTTP.Client (withManager) +#endif import Network.HTTP.Client.Internal (addProxy) import Network.HTTP.Client.TLS (tlsManagerSettings) import System.Environment (getEnv) @@ -905,7 +910,11 @@ openURL u Right pr -> case parseUrl pr of Just r -> addProxy (host r) (port r) req Nothing -> req +#if MIN_VERSION_http_client(0,4,18) + resp <- newManager tlsManagerSettings >>= httpLbs req' +#else resp <- withManager tlsManagerSettings $ httpLbs req' +#endif return (BS.concat $ toChunks $ responseBody resp, UTF8.toString `fmap` lookup hContentType (responseHeaders resp)) #else -- cgit v1.2.3