From 50609da78742286099ee95064a1f1def6146807e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 16 Jul 2018 11:56:47 -0400 Subject: [PATCH] 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. --- CHANGELOG | 2 ++ Utility/Url.hs | 2 +- ...portfeed_bad_request_without_User-Agent__58__.mdwn | 2 ++ ...omment_2_ae6eee51655aa6b1152ade3bdf7f700f._comment | 11 +++++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/importfeed_bad_request_without_User-Agent__58__/comment_2_ae6eee51655aa6b1152ade3bdf7f700f._comment diff --git a/CHANGELOG b/CHANGELOG index cf5288d8a3..e9d3906655 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 Fri, 22 Jun 2018 10:36:22 -0400 diff --git a/Utility/Url.hs b/Utility/Url.hs index 31dca28154..ebefc1213e 100644 --- a/Utility/Url.hs +++ b/Utility/Url.hs @@ -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 diff --git a/doc/bugs/importfeed_bad_request_without_User-Agent__58__.mdwn b/doc/bugs/importfeed_bad_request_without_User-Agent__58__.mdwn index f3aaaffc36..5c9b31713e 100644 --- a/doc/bugs/importfeed_bad_request_without_User-Agent__58__.mdwn +++ b/doc/bugs/importfeed_bad_request_without_User-Agent__58__.mdwn @@ -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]] diff --git a/doc/bugs/importfeed_bad_request_without_User-Agent__58__/comment_2_ae6eee51655aa6b1152ade3bdf7f700f._comment b/doc/bugs/importfeed_bad_request_without_User-Agent__58__/comment_2_ae6eee51655aa6b1152ade3bdf7f700f._comment new file mode 100644 index 0000000000..eb9d012eed --- /dev/null +++ b/doc/bugs/importfeed_bad_request_without_User-Agent__58__/comment_2_ae6eee51655aa6b1152ade3bdf7f700f._comment @@ -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. +"""]]