debug the full adjusted Request

So that the user-agent etc are included in the debug.
This commit is contained in:
Joey Hess 2018-10-04 13:45:27 -04:00
parent 4b793fb077
commit 45e09ea7f3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -328,15 +328,15 @@ download' noerror meterupdate url file uo =
downloadconduit req = catchMaybeIO (getFileSize file) >>= \case
Nothing -> runResourceT $ do
liftIO $ debugM "url" (show req')
resp <- http (applyRequest uo req') (httpManager uo)
resp <- http req' (httpManager uo)
if responseStatus resp == ok200
then store zeroBytesProcessed WriteMode resp
else showrespfailure resp
Just sz -> resumeconduit req' sz
where
req' = applyRequest uo $ req
-- Override http-client's default decompression of gzip
-- compressed files. We want the unmodified file content.
req' = req
{ requestHeaders = (hAcceptEncoding, "identity") :
filter ((/= hAcceptEncoding) . fst)
(requestHeaders req)