Discard the space after colon in HTTP respone headers (#143)

* Discard the space after colon in HTTP respone headers

* also discard tab
This commit is contained in:
JinmingHu 2020-05-29 00:11:46 +08:00 committed by GitHub
parent 2c058bd053
commit 39f7c37e90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,6 +99,10 @@ static void ParseHeader(std::string const& header, std::unique_ptr<Response>& 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