avoid deprecation warning from parseUrl
This commit is contained in:
parent
a7a301fd7d
commit
de7b2ffa72
1 changed files with 7 additions and 1 deletions
|
@ -136,7 +136,7 @@ assumeUrlExists = UrlInfo True Nothing Nothing
|
||||||
- also returning its size and suggested filename if available. -}
|
- also returning its size and suggested filename if available. -}
|
||||||
getUrlInfo :: URLString -> UrlOptions -> IO UrlInfo
|
getUrlInfo :: URLString -> UrlOptions -> IO UrlInfo
|
||||||
getUrlInfo url uo = case parseURIRelaxed url of
|
getUrlInfo url uo = case parseURIRelaxed url of
|
||||||
Just u -> case parseUrl (show u) of
|
Just u -> case parseurlconduit (show u) of
|
||||||
Just req -> catchJust
|
Just req -> catchJust
|
||||||
-- When http redirects to a protocol which
|
-- When http redirects to a protocol which
|
||||||
-- conduit does not support, it will throw
|
-- conduit does not support, it will throw
|
||||||
|
@ -216,6 +216,12 @@ getUrlInfo url uo = case parseURIRelaxed url of
|
||||||
_ | isftp && isJust len -> good
|
_ | isftp && isJust len -> good
|
||||||
_ -> dne
|
_ -> dne
|
||||||
|
|
||||||
|
#if MIN_VERSION_http_client(0,4,30)
|
||||||
|
parseurlconduit = parseUrlThrow
|
||||||
|
#else
|
||||||
|
parseurlconduit = parseUrl
|
||||||
|
#endif
|
||||||
|
|
||||||
-- Parse eg: attachment; filename="fname.ext"
|
-- Parse eg: attachment; filename="fname.ext"
|
||||||
-- per RFC 2616
|
-- per RFC 2616
|
||||||
contentDispositionFilename :: String -> Maybe FilePath
|
contentDispositionFilename :: String -> Maybe FilePath
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue