Commit d14b0a48 authored by Kenton Varda's avatar Kenton Varda

HttpHeaders::forEach() should be const.

parent 8ec657ab
...@@ -249,7 +249,7 @@ public: ...@@ -249,7 +249,7 @@ public:
// Read a header. // Read a header.
template <typename Func> template <typename Func>
void forEach(Func&& func); void forEach(Func&& func) const;
// Calls `func(name, value)` for each header in the set -- including headers that aren't mapped // Calls `func(name, value)` for each header in the set -- including headers that aren't mapped
// to IDs in the header table. Both inputs are of type kj::StringPtr. // to IDs in the header table. Both inputs are of type kj::StringPtr.
...@@ -601,7 +601,7 @@ inline void HttpHeaders::unset(HttpHeaderId id) { ...@@ -601,7 +601,7 @@ inline void HttpHeaders::unset(HttpHeaderId id) {
} }
template <typename Func> template <typename Func>
inline void HttpHeaders::forEach(Func&& func) { inline void HttpHeaders::forEach(Func&& func) const {
for (auto i: kj::indices(indexedHeaders)) { for (auto i: kj::indices(indexedHeaders)) {
if (indexedHeaders[i] != nullptr) { if (indexedHeaders[i] != nullptr) {
func(table->idToString(HttpHeaderId(table, i)), indexedHeaders[i]); func(table->idToString(HttpHeaderId(table, i)), indexedHeaders[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment