From cb11d9412e8705058f3b9ec7892ec2cde6ea7862 Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 23 Jul 2019 23:08:50 -0400 Subject: [PATCH] Fixed connection end problem with HTTP/1.0 client --- httplib.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/httplib.h b/httplib.h index c6ea343..e3443e5 100644 --- a/httplib.h +++ b/httplib.h @@ -2033,6 +2033,11 @@ Server::process_request(Stream &strm, bool last_connection, connection_close = true; } + if (req.version == "HTTP/1.0" && + req.get_header_value("Connection") != "Keep-Alive") { + connection_close = true; + } + req.set_header("REMOTE_ADDR", strm.get_remote_addr().c_str()); // Body