diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-22 01:13:09 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-22 01:13:09 -0400 |
commit | 84ac8c58db30637db4fb88566530b6293f12dab0 (patch) | |
tree | 72b7d1bae98ee22b34d722554069b68eea47513f /Config.hs | |
parent | 5fbe83f595bf5957376544ee83b3cc46cc2323ed (diff) |
Add annex.httpheaders and annex.httpheader-command config settings
Allow custom headers to be sent with all HTTP requests.
(Requested by the Internet Archive)
Diffstat (limited to 'Config.hs')
-rw-r--r-- | Config.hs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -96,3 +96,12 @@ getDiskReserve = fromMaybe megabyte . readSize dataUnits <$> getConfig "annex.diskreserve" "" where megabyte = 1000000 + +{- Gets annex.httpheaders or annex.httpheaders-command setting, + - splitting it into lines. -} +getHttpHeaders :: Annex [String] +getHttpHeaders = do + cmd <- getConfig "annex.httpheaders-command" "" + if (null cmd) + then fromRepo $ Git.Config.getList "annex.httpheaders" + else lines . snd <$> liftIO (pipeFrom "sh" ["-c", cmd]) |