summaryrefslogtreecommitdiff
path: root/Utility/Url.hs
diff options
context:
space:
mode:
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