diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-10-13 13:01:02 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-10-13 13:01:49 +0200 |
commit | 6d13567ac5c689dde3c1e4362b17fb42678e2b88 (patch) | |
tree | dd4ddd5260d809139dbe6c37d3d50b1c2af30ddd /src/Text | |
parent | 4a1ef0b51d234a876d0621c710413ebebff69239 (diff) | |
download | pandoc-6d13567ac5c689dde3c1e4362b17fb42678e2b88.tar.gz |
Allow http-client 0.4.30, which is the version in stackage lts.
Previously we required 0.5.
Remove CPP conditionals for earlier versions.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 48bcc9a51..407ff97db 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -153,16 +153,8 @@ import Paths_pandoc (getDataFileName) #ifdef HTTP_CLIENT import Network.HTTP.Client (httpLbs, responseBody, responseHeaders, Request(port,host)) -#if MIN_VERSION_http_client(0,4,30) import Network.HTTP.Client (parseRequest) -#else -import Network.HTTP.Client (parseUrl) -#endif -#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) @@ -966,11 +958,7 @@ openURL u in return $ Right (decodeLenient contents, Just mime) #ifdef HTTP_CLIENT | otherwise = withSocketsDo $ E.try $ do -#if MIN_VERSION_http_client(0,4,30) let parseReq = parseRequest -#else - let parseReq = parseUrl -#endif (proxy :: Either E.SomeException String) <- E.try $ getEnv "http_proxy" req <- parseReq u req' <- case proxy of @@ -978,11 +966,7 @@ openURL u Right pr -> (parseReq pr >>= \r -> return $ addProxy (host r) (port r) req) `mplus` return 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 |