From f04086c72b59d22e3a9c53bb4560856a6d00eeba Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 18 Jun 2009 16:13:42 +0000 Subject: [PATCH] FS#118 - Add "Connection: close" by default for HTTP 1.1 requests git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1148 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/Network/Http.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SFML/Network/Http.cpp b/src/SFML/Network/Http.cpp index 69ee02735..64793406d 100644 --- a/src/SFML/Network/Http.cpp +++ b/src/SFML/Network/Http.cpp @@ -390,6 +390,10 @@ Http::Response Http::SendRequest(const Http::Request& Req, float Timeout) { ToSend.SetField("Content-Type", "application/x-www-form-urlencoded"); } + if ((ToSend.myMajorVersion * 10 + ToSend.myMinorVersion >= 11) && !ToSend.HasField("Connection")) + { + ToSend.SetField("Connection", "close"); + } // Prepare the response Response Received;