aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-07-21 16:32:44 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-07-21 16:32:44 -0700
commitec5960ab119bc821f3dc6589c48c1a88c6bb1bac (patch)
treea989937223a4b83ec8c4cc820ec154dd4a144cb8
parent450bef90e094048cc3a7947c213a68b37a85c3a8 (diff)
downloadpandoc-ec5960ab119bc821f3dc6589c48c1a88c6bb1bac.tar.gz
Use newManager instead of withManager in recent http-client.
This avoids a deprecation warning.
-rw-r--r--src/Text/Pandoc/Shared.hs11
1 files changed, 10 insertions, 1 deletions
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