diff options
-rw-r--r-- | pandoc.cabal | 14 | ||||
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 21 | ||||
-rw-r--r-- | stack.full.yaml | 1 | ||||
-rw-r--r-- | stack.pkg.yaml | 1 | ||||
-rw-r--r-- | stack.yaml | 1 |
5 files changed, 4 insertions, 34 deletions
diff --git a/pandoc.cabal b/pandoc.cabal index f9ce1efd2..a713e9372 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -264,10 +264,6 @@ Flag weigh-pandoc Description: Build weigh-pandoc to measure memory usage. Default: False -Flag https - Description: Enable support for downloading of resources over https. - Default: True - Flag network-uri Description: Get Network.URI from the network-uri package Default: True @@ -316,7 +312,10 @@ Library JuicyPixels >= 3.1.6.1 && < 3.3, Glob >= 0.7 && < 0.8, cmark >= 0.5 && < 0.6, - doctemplates >= 0.1 && < 0.2 + doctemplates >= 0.1 && < 0.2, + http-client >= 0.4.30 && < 0.6, + http-client-tls >= 0.2.4 && < 0.4, + http-types >= 0.8 && < 0.10 if os(windows) Cpp-options: -D_WINDOWS else @@ -330,11 +329,6 @@ Library Build-Depends: network-uri >= 2.6 && < 2.7, network >= 2.6 else Build-Depends: network >= 2 && < 2.6 - if flag(https) - Build-Depends: http-client >= 0.4.30 && < 0.6, - http-client-tls >= 0.2.4 && < 0.4, - http-types >= 0.8 && < 0.10 - cpp-options: -DHTTP_CLIENT if flag(embed_data_files) cpp-options: -DEMBED_DATA_FILES build-depends: file-embed >= 0.0 && < 0.1 diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 8256d14c0..44a26509b 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -140,7 +140,6 @@ import Text.Pandoc.Data (dataFiles) #else import Paths_pandoc (getDataFileName) #endif -#ifdef HTTP_CLIENT import Network.HTTP.Client (httpLbs, responseBody, responseHeaders, Request(port,host,requestHeaders)) import Network.HTTP.Client (parseRequest) @@ -150,12 +149,6 @@ import Network.HTTP.Client.TLS (tlsManagerSettings) import System.Environment (getEnv) import Network.HTTP.Types.Header ( hContentType, hUserAgent) import Network (withSocketsDo) -#else -import Network.URI (parseURI) -import Network.HTTP (findHeader, rspBody, - RequestMethod(..), HeaderName(..), mkRequest) -import Network.Browser (browse, setAllowRedirects, setOutHandler, request) -#endif -- | Version number of pandoc library. pandocVersion :: String @@ -715,7 +708,6 @@ openURL u let mime = takeWhile (/=',') u'' contents = B8.pack $ unEscapeString $ drop 1 $ dropWhile (/=',') u'' in return (decodeLenient contents, Just mime) -#ifdef HTTP_CLIENT | otherwise = withSocketsDo $ do let parseReq = parseRequest (proxy :: Either IOError String) <- @@ -738,19 +730,6 @@ openURL u resp <- newManager tlsManagerSettings >>= httpLbs req'' return (BS.concat $ toChunks $ responseBody resp, UTF8.toString `fmap` lookup hContentType (responseHeaders resp)) -#else - | otherwise = getBodyAndMimeType `fmap` browse - (do liftIO $ UTF8.hPutStrLn stderr $ "Fetching " ++ u ++ "..." - setOutHandler $ const (return ()) - setAllowRedirects True - request (getRequest' u')) - where getBodyAndMimeType (_, r) = (rspBody r, findHeader HdrContentType r) - getRequest' uriString = case parseURI uriString of - Nothing -> error ("Not a valid URL: " ++ - uriString) - Just v -> mkRequest GET v - u' = escapeURIString (/= '|') u -- pipes are rejected by Network.URI -#endif -- -- Error reporting diff --git a/stack.full.yaml b/stack.full.yaml index f05ccbce3..e5fff5a4e 100644 --- a/stack.full.yaml +++ b/stack.full.yaml @@ -3,7 +3,6 @@ flags: pandoc: trypandoc: false - https: true embed_data_files: false old-locale: false network-uri: true diff --git a/stack.pkg.yaml b/stack.pkg.yaml index 864982278..a131f14cb 100644 --- a/stack.pkg.yaml +++ b/stack.pkg.yaml @@ -1,7 +1,6 @@ flags: pandoc: trypandoc: false - https: true embed_data_files: true old-locale: false network-uri: true diff --git a/stack.yaml b/stack.yaml index b9f02b364..14769525a 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,7 +1,6 @@ flags: pandoc: trypandoc: false - https: true embed_data_files: false old-locale: false network-uri: true |