fix User-Agent reversion

Send User-Agent and any configured annex.http-headers when downloading with
http, fixes reversion introduced when switching to http-client.

This commit was sponsored by mo on Patreon.
This commit is contained in:
Joey Hess 2018-07-16 11:56:47 -04:00
parent bd6799ebef
commit 50609da787
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 16 additions and 1 deletions

View file

@ -17,6 +17,8 @@ git-annex (6.20180627) UNRELEASED; urgency=medium
in a directory owned by root. Note that this prevents using the
standalone bundle in environments where HOME is not writable.
* unused --from: Allow specifiying a repository by uuid or description.
* Send User-Agent and any configured annex.http-headers when downloading
with http, fixes reversion introduced when switching to http-client.
-- Joey Hess <id@joeyh.name> Fri, 22 Jun 2018 10:36:22 -0400

View file

@ -315,7 +315,7 @@ download meterupdate url file uo =
downloadconduit req = catchMaybeIO (getFileSize file) >>= \case
Nothing -> runResourceT $ do
resp <- http req' (httpManager uo)
resp <- http (applyRequest uo req') (httpManager uo)
if responseStatus resp == ok200
then store zeroBytesProcessed WriteMode resp
else showrespfailure resp

View file

@ -224,3 +224,5 @@ Note that the only addition was adding a `User-Agent:` header (copied from the `
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
Absolutely :-) `git annex` has been my podcatcher, and media management tool for years. Thanks for writing it!
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,11 @@
[[!comment format=mdwn
username="joey"
subject="""comment 2"""
date="2018-07-16T15:48:08Z"
content="""
Hmm, it should be sending a user agent.
Wow, it's not sending a user agent!!!
Thank you very much for noticing this glaring omission.
"""]]