Fix problem caused by #1975
This commit is contained in:
parent
bfef4b3e9b
commit
412ba04d19
@ -7702,6 +7702,7 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
|
|||||||
|
|
||||||
if (!req.has_header("Accept")) { req.set_header("Accept", "*/*"); }
|
if (!req.has_header("Accept")) { req.set_header("Accept", "*/*"); }
|
||||||
|
|
||||||
|
if (!req.content_receiver) {
|
||||||
if (!req.has_header("Accept-Encoding")) {
|
if (!req.has_header("Accept-Encoding")) {
|
||||||
std::string accept_encoding;
|
std::string accept_encoding;
|
||||||
#ifdef CPPHTTPLIB_BROTLI_SUPPORT
|
#ifdef CPPHTTPLIB_BROTLI_SUPPORT
|
||||||
@ -7720,6 +7721,7 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
|
|||||||
req.set_header("User-Agent", agent);
|
req.set_header("User-Agent", agent);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
if (req.body.empty()) {
|
if (req.body.empty()) {
|
||||||
if (req.content_provider_) {
|
if (req.content_provider_) {
|
||||||
|
@ -5609,6 +5609,7 @@ TEST(LongPollingTest, ClientCloseDetection) {
|
|||||||
auto count = 10;
|
auto count = 10;
|
||||||
while (count > 0 && sink.is_writable()) {
|
while (count > 0 && sink.is_writable()) {
|
||||||
this_thread::sleep_for(chrono::milliseconds(10));
|
this_thread::sleep_for(chrono::milliseconds(10));
|
||||||
|
count--;
|
||||||
}
|
}
|
||||||
EXPECT_FALSE(sink.is_writable()); // the socket is closed
|
EXPECT_FALSE(sink.is_writable()); // the socket is closed
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user