Skip to content

Commit cb11d94

Browse files
committed
Fixed connection end problem with HTTP/1.0 client
1 parent 2d30c59 commit cb11d94

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

httplib.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,6 +2033,11 @@ Server::process_request(Stream &strm, bool last_connection,
20332033
connection_close = true;
20342034
}
20352035

2036+
if (req.version == "HTTP/1.0" &&
2037+
req.get_header_value("Connection") != "Keep-Alive") {
2038+
connection_close = true;
2039+
}
2040+
20362041
req.set_header("REMOTE_ADDR", strm.get_remote_addr().c_str());
20372042

20382043
// Body

0 commit comments

Comments
 (0)