git.iko.soy/typeable/pandoc
on master help sign in
Allow http-client 0.4.30, which is the version in stackage lts.

Previously we required 0.5. Remove CPP conditionals for earlier versions.

commit6d13567ac5c689dde3c1e4362b17fb42678e2b88 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 13 Oct 2016, 13:01 (10 years ago) parent4a1ef0b
2 files changed+2−18
pandoc.cabal+2−2 src/Text/Pandoc/Shared.hs−16
pandoc.cabal+2−2
@@ -301,8 +301,8 @@ Library
301301 else
302302 Build-Depends: network >= 2 && < 2.6
303303 if flag(https)
304− Build-Depends: http-client >= 0.5 && < 0.6,
305− http-client-tls >= 0.3 && < 0.4,
304+ Build-Depends: http-client >= 0.4.30 && < 0.6,
305+ http-client-tls >= 0.2.4 && < 0.4,
306306 http-types >= 0.8 && < 0.10
307307 cpp-options: -DHTTP_CLIENT
308308 if flag(embed_data_files)
src/Text/Pandoc/Shared.hs−16
@@ -153,16 +153,8 @@ import Paths_pandoc (getDataFileName)
153153#ifdef HTTP_CLIENT
154154import Network.HTTP.Client (httpLbs, responseBody, responseHeaders,
155155 Request(port,host))
156−#if MIN_VERSION_http_client(0,4,30)
157156import Network.HTTP.Client (parseRequest)
158−#else
159−import Network.HTTP.Client (parseUrl)
160−#endif
161−#if MIN_VERSION_http_client(0,4,18)
162157import Network.HTTP.Client (newManager)
163−#else
164−import Network.HTTP.Client (withManager)
165−#endif
166158import Network.HTTP.Client.Internal (addProxy)
167159import Network.HTTP.Client.TLS (tlsManagerSettings)
168160import System.Environment (getEnv)
@@ -966,11 +958,7 @@ openURL u
966958 in return $ Right (decodeLenient contents, Just mime)
967959#ifdef HTTP_CLIENT
968960 | otherwise = withSocketsDo $ E.try $ do
969−#if MIN_VERSION_http_client(0,4,30)
970961 let parseReq = parseRequest
971−#else
972− let parseReq = parseUrl
973−#endif
974962 (proxy :: Either E.SomeException String) <- E.try $ getEnv "http_proxy"
975963 req <- parseReq u
976964 req' <- case proxy of
@@ -978,11 +966,7 @@ openURL u
978966 Right pr -> (parseReq pr >>= \r ->
979967 return $ addProxy (host r) (port r) req)
980968 `mplus` return req
981−#if MIN_VERSION_http_client(0,4,18)
982969 resp <- newManager tlsManagerSettings >>= httpLbs req'
983−#else
984− resp <- withManager tlsManagerSettings $ httpLbs req'
985−#endif
986970 return (BS.concat $ toChunks $ responseBody resp,
987971 UTF8.toString `fmap` lookup hContentType (responseHeaders resp))
988972#else