summaryrefslogtreecommitdiff
path: root/Annex/Content.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-28 14:35:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-28 14:35:21 -0400
commita05cefbd7cdfc75109d8f55c4cb699352745841c (patch)
treea3d10d759b00a2c00340d352827fe9d287bed07c /Annex/Content.hs
parent309750f7588d7c9a6eadbdd30b630250f766311f (diff)
Send a git-annex user-agent when downloading urls.
Overridable with --user-agent option. Not yet done for S3 or WebDAV due to limitations of libraries used -- nether allows a user-agent header to be specified. This commit sponsored by Michael Zehrer.
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r--Annex/Content.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index c7afa8070..da0189c74 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -43,7 +43,7 @@ import qualified Annex.Queue
import qualified Annex.Branch
import Utility.DiskFree
import Utility.FileMode
-import qualified Utility.Url as Url
+import qualified Annex.Url as Url
import Types.Key
import Utility.DataUnits
import Utility.CopyFile
@@ -458,7 +458,7 @@ downloadUrl urls file = go =<< annexWebDownloadCommand <$> Annex.getGitConfig
go Nothing = do
opts <- map Param . annexWebOptions <$> Annex.getGitConfig
headers <- getHttpHeaders
- liftIO $ anyM (\u -> Url.download u headers opts file) urls
+ anyM (\u -> Url.withUserAgent $ Url.download u headers opts file) urls
go (Just basecmd) = liftIO $ anyM (downloadcmd basecmd) urls
downloadcmd basecmd url =
boolSystem "sh" [Param "-c", Param $ gencmd url basecmd]