mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Fixed problem with keep-alive on client
This commit is contained in:
parent
a782d1b609
commit
037b4fc789
@ -2697,11 +2697,6 @@ inline void Client::write_request(Stream &strm, Request &req) {
|
|||||||
req.set_header("User-Agent", "cpp-httplib/0.2");
|
req.set_header("User-Agent", "cpp-httplib/0.2");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Support KeepAlive connection
|
|
||||||
// if (!req.has_header("Connection")) {
|
|
||||||
req.set_header("Connection", "close");
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (req.body.empty()) {
|
if (req.body.empty()) {
|
||||||
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH") {
|
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH") {
|
||||||
req.set_header("Content-Length", "0");
|
req.set_header("Content-Length", "0");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user