aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorLuca Muscariello <muscariello@ieee.org>2020-12-14 19:17:06 +0000
committerGerrit Code Review <gerrit@fd.io>2020-12-14 19:17:06 +0000
commit8e278cb44bb1c1a1dda3f2fff67df3e5034d37d6 (patch)
tree425e518714de78b8ab063bd325fe9d77bd0ed634 /libtransport
parenta19882afff8306e46148b4f6456257c84e89443c (diff)
parentb107d19d5d56e4e10913ac793530ecf4545c09d3 (diff)
Merge "[HICN-665] Convert headers to lower-case before storing them."
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/http/response.cc5
1 files changed, 4 insertions, 1 deletions
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);
}
}