Add annex.httpheaders and annex.httpheader-command config settings
Allow custom headers to be sent with all HTTP requests. (Requested by the Internet Archive)
This commit is contained in:
parent
5fbe83f595
commit
84ac8c58db
9 changed files with 66 additions and 27 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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue