aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Shared.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index f8c776e27..bf988875b 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -565,17 +565,16 @@ fetchItem sourceDir s =
cont <- B.readFile f
return (cont, mime)
--- TODO - have this return mime type too - then it can work for google
--- chart API, e.g.
-- | Read from a URL and return raw data and maybe mime type.
openURL :: String -> IO (B.ByteString, Maybe String)
openURL u = getBodyAndMimeType `fmap`
- browse (setAllowRedirects True >> request (getRequest' u))
+ browse (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
--
-- Error reporting