preserve other headers when adding resume header

It had lost the hAcceptEncoding header that is set as part of the
overriding of http-client's default decompression of compressed files.
Seems likely that would have caused resuming of compressed files to fail
in some cases.

This commit was sponsored by Brett Eisenberg on Patreon.
This commit is contained in:
Joey Hess 2020-11-19 14:41:33 -04:00
parent b90b9b936d
commit 728afbc4b1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -495,7 +495,7 @@ downloadConduit meterupdate req file uo =
-- when supported by the http server. The server may also opt to -- when supported by the http server. The server may also opt to
-- send the whole file rather than resuming. -- send the whole file rather than resuming.
resumedownload sz = join $ runResourceT $ do resumedownload sz = join $ runResourceT $ do
let req'' = req' { requestHeaders = resumeFromHeader sz : requestHeaders req } let req'' = req' { requestHeaders = resumeFromHeader sz : requestHeaders req' }
liftIO $ debugM "url" (show req'') liftIO $ debugM "url" (show req'')
resp <- http req'' (httpManager uo) resp <- http req'' (httpManager uo)
if responseStatus resp == partialContent206 if responseStatus resp == partialContent206