From b107d19d5d56e4e10913ac793530ecf4545c09d3 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 14 Dec 2020 16:56:55 +0100 Subject: [HICN-665] Convert headers to lower-case before storing them. Signed-off-by: Mauro Sardara Change-Id: I4bbd5c4adc56330eb3f5543c2b542d60e3135d1a --- libtransport/src/http/response.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libtransport/src/http/response.cc b/libtransport/src/http/response.cc index 79550898b..c665fbc5f 100644 --- a/libtransport/src/http/response.cc +++ b/libtransport/src/http/response.cc @@ -98,7 +98,10 @@ std::size_t HTTPResponse::parseHeaders(const uint8_t *buffer, std::size_t size, value_start++; } if (value_start < line.size()) { - headers[line.substr(0, param_end)] = + auto header = line.substr(0, param_end); + std::transform(header.begin(), header.end(), header.begin(), + [](unsigned char c) { return std::tolower(c); }); + headers[header] = line.substr(value_start, line.size() - value_start - 1); } } -- cgit 1.2.3-korg