From 39f7c37e90c09b04c7a7d38a3b87cd818e2f3416 Mon Sep 17 00:00:00 2001 From: JinmingHu Date: Fri, 29 May 2020 00:11:46 +0800 Subject: [PATCH] Discard the space after colon in HTTP respone headers (#143) * Discard the space after colon in HTTP respone headers * also discard tab --- sdk/platform/http_client/curl/src/curl_client.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/platform/http_client/curl/src/curl_client.cpp b/sdk/platform/http_client/curl/src/curl_client.cpp index 8972d8475..7483876ba 100644 --- a/sdk/platform/http_client/curl/src/curl_client.cpp +++ b/sdk/platform/http_client/curl/src/curl_client.cpp @@ -99,6 +99,10 @@ static void ParseHeader(std::string const& header, std::unique_ptr& re auto headerName = std::string(start, end); start = end + 1; // start value + while (start < header.end() && (*start == ' ' || *start == '\t')) + { + ++start; + } auto headerValue = std::string(start, header.end() - 2); // remove \r and \n from the end