refactor
This commit is contained in:
parent
daf4f62b0e
commit
45c9440cf9
1 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue