From ef820c4dd3aac720f29a5c4a8f7e60f63b4879dd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Sep 2016 12:02:15 -0400 Subject: avoid deprecation warning from parseUrl --- Utility/Url.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Utility/Url.hs') diff --git a/Utility/Url.hs b/Utility/Url.hs index 97536f7cf..9b68871dd 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -136,7 +136,7 @@ assumeUrlExists = UrlInfo True Nothing Nothing - also returning its size and suggested filename if available. -} getUrlInfo :: URLString -> UrlOptions -> IO UrlInfo getUrlInfo url uo = case parseURIRelaxed url of - Just u -> case parseUrl (show u) of + Just u -> case parseurlconduit (show u) of Just req -> catchJust -- When http redirects to a protocol which -- conduit does not support, it will throw @@ -216,6 +216,12 @@ getUrlInfo url uo = case parseURIRelaxed url of _ | isftp && isJust len -> good _ -> dne +#if MIN_VERSION_http_client(0,4,30) + parseurlconduit = parseUrlThrow +#else + parseurlconduit = parseUrl +#endif + -- Parse eg: attachment; filename="fname.ext" -- per RFC 2616 contentDispositionFilename :: String -> Maybe FilePath -- cgit v1.2.3