From ee8c8da8ccfc7e3eb33679fd8a3a465766f9d5f7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 18 May 2014 22:04:39 -0700 Subject: Removed dependency on conduit. * http-conduit flag is now https. * Instead of http-conduit, we depend on http-client and http-client-tls. --- src/Text/Pandoc/Shared.hs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 4f506b5a6..d8cbe46d9 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -118,11 +118,13 @@ import System.FilePath ( joinPath, splitDirectories ) #else import Paths_pandoc (getDataFileName) #endif -#ifdef HTTP_CONDUIT +#ifdef HTTP_CLIENT import Data.ByteString.Lazy (toChunks) -import Network.HTTP.Conduit (httpLbs, parseUrl, withManager, - responseBody, responseHeaders, addProxy, - Request(port,host)) +import Network.HTTP.Client (httpLbs, parseUrl, withManager, + responseBody, responseHeaders, + Request(port,host)) +import Network.HTTP.Client.Internal (addProxy) +import Network.HTTP.Client.TLS (tlsManagerSettings) import System.Environment (getEnv) import Network.HTTP.Types.Header ( hContentType) import Network (withSocketsDo) @@ -665,7 +667,7 @@ openURL u let mime = takeWhile (/=',') $ drop 5 u contents = B8.pack $ unEscapeString $ drop 1 $ dropWhile (/=',') u in return $ Right (decodeLenient contents, Just mime) -#ifdef HTTP_CONDUIT +#ifdef HTTP_CLIENT | otherwise = withSocketsDo $ E.try $ do req <- parseUrl u (proxy :: Either E.SomeException String) <- E.try $ getEnv "http_proxy" @@ -674,7 +676,7 @@ openURL u Right pr -> case parseUrl pr of Just r -> addProxy (host r) (port r) req Nothing -> req - resp <- withManager $ httpLbs req' + resp <- withManager tlsManagerSettings $ httpLbs req' return (BS.concat $ toChunks $ responseBody resp, UTF8.toString `fmap` lookup hContentType (responseHeaders resp)) #else -- cgit v1.2.3