@@ -7702,24 +7702,26 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
77027702
77037703 if (!req.has_header (" Accept" )) { req.set_header (" Accept" , " */*" ); }
77047704
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;
77077708#ifdef CPPHTTPLIB_BROTLI_SUPPORT
7708- accept_encoding = " br" ;
7709+ accept_encoding = " br" ;
77097710#endif
77107711#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" ;
77137714#endif
7714- req.set_header (" Accept-Encoding" , accept_encoding);
7715- }
7715+ req.set_header (" Accept-Encoding" , accept_encoding);
7716+ }
77167717
77177718#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+ }
77227723#endif
7724+ };
77237725
77247726 if (req.body .empty ()) {
77257727 if (req.content_provider_ ) {
0 commit comments