diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-10-15 10:34:19 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-10-15 10:34:19 -0400 |
commit | b00e84255446aceab5fc0c941c115e71276f8a5e (patch) | |
tree | 73d51072e27babe1ca19ef606c3eada7ced45dbd /Utility | |
parent | 592b273629f84c24ccd4eb1d50c5c00272bfcd7b (diff) |
refactor
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Url.hs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Utility/Url.hs b/Utility/Url.hs index 19568fda8..c53ed5c6a 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -12,6 +12,7 @@ module Utility.Url ( closeManager, + managerSettings, URLString, UserAgent, UrlOptions, @@ -48,6 +49,13 @@ closeManager :: Manager -> IO () closeManager _ = return () #endif +managerSettings :: ManagerSettings +#if MIN_VERSION_http_conduit(2,1,7) +managerSettings = tlsManagerSettings +#else +managerSettings = conduitManagerSettings +#endif + type URLString = String type Headers = [String] @@ -176,12 +184,7 @@ getUrlInfo url uo = case parseURIRelaxed url of filter (\p -> fst p == h) . responseHeaders existsconduit req = do - mgr <- newManager -#if MIN_VERSION_http_conduit(2,1,7) - tlsManagerSettings -#else - conduitManagerSettings -#endif + mgr <- newManager managerSettings let req' = headRequest (applyRequest uo req) ret <- runResourceT $ do resp <- http req' mgr |