@@ -565,17 +565,16 @@ fetchItem sourceDir s =
565565 cont <- B.readFile f
566566 return (cont, mime)
567567
568−-- TODO - have this return mime type too - then it can work for google
569−-- chart API, e.g.
570568-- | Read from a URL and return raw data and maybe mime type.
571569openURL :: String -> IO (B.ByteString, Maybe String)
572570openURL u = getBodyAndMimeType `fmap`
573− browse (setAllowRedirects True >> request (getRequest' u))
571+ browse (setAllowRedirects True >> request (getRequest' u'))
574572 where getBodyAndMimeType (_, r) = (rspBody r, findHeader HdrContentType r)
575573 getRequest' uriString = case parseURI uriString of
576574 Nothing -> error ("Not a valid URL: " ++
577575 uriString)
578576 Just v -> mkRequest GET v
577+ u' = escapeURIString (/= '|') u -- pipes are rejected by Network.URI
579578
580579--
581580-- Error reporting