@@ -41,7 +41,16 @@ import Data.ByteString.Lazy (toChunks)
4141import Data.Text (Text , pack , unpack )
4242import Data.Time (TimeZone , UTCTime )
4343import Data.Unique (hashUnique )
44+ import Network.Connection (TLSSettings (.. ))
45+ import qualified Network.TLS as TLS
46+ import qualified Network.TLS.Extra as TLS
47+ import Network.HTTP.Client
48+ (httpLbs , responseBody , responseHeaders ,
49+ Request (port , host , requestHeaders ), parseRequest , newManager )
50+ import Network.HTTP.Client.Internal (addProxy )
51+ import Network.HTTP.Client.TLS (mkManagerSettings )
4452import Network.HTTP.Types.Header ( hContentType )
53+ import Network.Socket (withSocketsDo )
4554import Network.URI (URI (.. ), parseURI , unEscapeString )
4655import System.Directory (createDirectoryIfMissing )
4756import System.Environment (getEnv )
@@ -74,6 +83,7 @@ import qualified System.FilePath.Glob
7483import qualified System.Random
7584import qualified Text.Pandoc.UTF8 as UTF8
7685import Data.Default (def )
86+ import System.X509 (getSystemCertificateStore )
7787#ifndef EMBED_DATA_FILES
7888import qualified Paths_pandoc as Paths
7989#endif
@@ -119,9 +129,6 @@ openURL u
119129 | Just (URI { uriScheme = " data:" ,
120130 uriPath = upath }) <- parseURI (T. unpack u)
121131 = pure $ extractURIData upath
122- #if defined(wasm32_HOST_ARCH)
123- | otherwise = error " Text.Pandoc.Class.IO.openURL"
124- #else
125132 | otherwise = do
126133 let toReqHeader (n, v) = (CI. mk (UTF8. fromText n), UTF8. fromText v)
127134 customHeaders <- map toReqHeader <$> getsCommonState stRequestHeaders
@@ -161,7 +168,6 @@ openURL u
161168 case res of
162169 Right r -> return r
163170 Left e -> throwError $ PandocHttpError u e
164- #endif
165171
166172-- | Read the lazy ByteString contents from a file path, raising an error on
167173-- failure.
0 commit comments