merge from http-client-restricted

I made some improvements to its API after splitting it out of git-annex,
so merge those back in.

This is groundwork for removing the embedded copy of it and depending on
it.

Also moved the managerResponseTimeout disabling to Annex.Url as it's
git-annex specific.

This commit was sponsored by Ethan Aubin on Patreon.
This commit is contained in:
Joey Hess 2019-07-17 16:48:50 -04:00
parent b3c2ae2fc7
commit 7fd650355e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 112 additions and 44 deletions

View file

@ -11,7 +11,6 @@
module Utility.Url (
newManager,
managerSettings,
URLString,
UserAgent,
Scheme,
@ -62,10 +61,6 @@ import Data.Conduit
import Text.Read
import System.Log.Logger
managerSettings :: ManagerSettings
managerSettings = tlsManagerSettings
{ managerResponseTimeout = responseTimeoutNone }
type URLString = String
type Headers = [String]
@ -103,7 +98,7 @@ defUrlOptions = UrlOptions
<*> pure []
<*> pure (DownloadWithConduit (DownloadWithCurlRestricted mempty))
<*> pure id
<*> newManager managerSettings
<*> newManager tlsManagerSettings
<*> pure (S.fromList $ map mkScheme ["http", "https", "ftp"])
mkUrlOptions :: Maybe UserAgent -> Headers -> UrlDownloader -> Manager -> S.Set Scheme -> UrlOptions