@@ -7702,24 +7702,26 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
7702
7702
7703
7703
if (!req.has_header (" Accept" )) { req.set_header (" Accept" , " */*" ); }
7704
7704
7705
- if (!req.has_header (" Accept-Encoding" )) {
7706
- std::string accept_encoding;
7705
+ if (!req.content_receiver ) {
7706
+ if (!req.has_header (" Accept-Encoding" )) {
7707
+ std::string accept_encoding;
7707
7708
#ifdef CPPHTTPLIB_BROTLI_SUPPORT
7708
- accept_encoding = " br" ;
7709
+ accept_encoding = " br" ;
7709
7710
#endif
7710
7711
#ifdef CPPHTTPLIB_ZLIB_SUPPORT
7711
- if (!accept_encoding.empty ()) { accept_encoding += " , " ; }
7712
- accept_encoding += " gzip, deflate" ;
7712
+ if (!accept_encoding.empty ()) { accept_encoding += " , " ; }
7713
+ accept_encoding += " gzip, deflate" ;
7713
7714
#endif
7714
- req.set_header (" Accept-Encoding" , accept_encoding);
7715
- }
7715
+ req.set_header (" Accept-Encoding" , accept_encoding);
7716
+ }
7716
7717
7717
7718
#ifndef CPPHTTPLIB_NO_DEFAULT_USER_AGENT
7718
- if (!req.has_header (" User-Agent" )) {
7719
- auto agent = std::string (" cpp-httplib/" ) + CPPHTTPLIB_VERSION;
7720
- req.set_header (" User-Agent" , agent);
7721
- }
7719
+ if (!req.has_header (" User-Agent" )) {
7720
+ auto agent = std::string (" cpp-httplib/" ) + CPPHTTPLIB_VERSION;
7721
+ req.set_header (" User-Agent" , agent);
7722
+ }
7722
7723
#endif
7724
+ };
7723
7725
7724
7726
if (req.body .empty ()) {
7725
7727
if (req.content_provider_ ) {
0 commit comments