aboutsummaryrefslogtreecommitdiff
path: root/Utility/Url.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-09-07 12:02:15 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-09-07 12:02:38 -0400
commitef820c4dd3aac720f29a5c4a8f7e60f63b4879dd (patch)
tree1f861e639d6730cf5b061e65b54ea969848d08c1 /Utility/Url.hs
parent22cd1a21bfcc4096cc53240fd16cc10052aeecd0 (diff)
avoid deprecation warning from parseUrl
Diffstat (limited to 'Utility/Url.hs')
-rw-r--r--Utility/Url.hs8
1 files changed, 7 insertions, 1 deletions
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