Code Review
/
hicn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
72a9acc
)
[HICN-665] Convert headers to lower-case before storing them.
10/30410/1
author
Mauro Sardara
<msardara@cisco.com>
Mon, 14 Dec 2020 15:56:55 +0000
(16:56 +0100)
committer
Mauro Sardara
<msardara@cisco.com>
Mon, 14 Dec 2020 15:56:55 +0000
(16:56 +0100)
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I4bbd5c4adc56330eb3f5543c2b542d60e3135d1a
libtransport/src/http/response.cc
patch
|
blob
|
history
diff --git
a/libtransport/src/http/response.cc
b/libtransport/src/http/response.cc
index
7955089
..
c665fbc
100644
(file)
--- 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);
}
}