Closed amolvmisal closed 8 months ago
Thanks @amolvmisal for reporting! I will look into it tomorrow.
Workaroud for while I'm working on a PR for it:
cpr::Session session;
session.SetHeader(cpr::Header{{"Accept-Encoding", "gzip"}});
A new PR to fix this exists: https://github.com/libcpr/cpr/pull/1010
Could you please verify, this fixes your issue?
@COM8 my apology for late reply and thanks for quick response. I can confirm #1010 fixes the issue
Description
cpr::AcceptEncoding
parameter does not work when downloading withcpr::Download
causing it to fail to decode the downloaded file which is a gzip encoded.Example/How to Reproduce
After downloading you can see
cpr::Download
failed to decode the downloaded file.Possible Fix
Following piece of code in
Session::prepareCommonDownload
solved the issue;This piece of code is same as in
Session::prepareCommon
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment