From 0ffb8af8e38fa71f19dbebcebbbfc37937d1bf90 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 21 Jun 2018 16:53:44 +0200 Subject: [PATCH] Conform to RFC for CRLF in HTTP requests refs #6242 --- lib/remote/httprequest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/remote/httprequest.cpp b/lib/remote/httprequest.cpp index 8f6c11e31..4ba9aad69 100644 --- a/lib/remote/httprequest.cpp +++ b/lib/remote/httprequest.cpp @@ -194,7 +194,7 @@ void HttpRequest::AddHeader(const String& key, const String& value) void HttpRequest::FinishHeaders() { if (m_State == HttpRequestStart) { - String rqline = RequestMethod + " " + RequestUrl->Format(true) + " HTTP/1." + (ProtocolVersion == HttpVersion10 ? "0" : "1") + "\n"; + String rqline = RequestMethod + " " + RequestUrl->Format(true) + " HTTP/1." + (ProtocolVersion == HttpVersion10 ? "0" : "1") + "\r\n"; m_Stream->Write(rqline.CStr(), rqline.GetLength()); m_State = HttpRequestHeaders; } @@ -211,11 +211,11 @@ void HttpRequest::FinishHeaders() ObjectLock olock(Headers); for (const Dictionary::Pair& kv : Headers) { - String header = kv.first + ": " + kv.second + "\n"; + String header = kv.first + ": " + kv.second + "\r\n"; m_Stream->Write(header.CStr(), header.GetLength()); } - m_Stream->Write("\n", 1); + m_Stream->Write("\r\n", 2); m_State = HttpRequestBody; } -- 2.40.0