http: initialize HeaderMap from iterator#11360
Merged
Merged
Conversation
Signed-off-by: Shikugawa <rei@tetrate.io>
Member
Author
|
/review @mattklein123 |
mattklein123
requested changes
May 29, 2020
| static void | ||
| initFromInitList(HeaderMap& new_header_map, | ||
| const std::initializer_list<std::pair<LowerCaseString, std::string>>& values); | ||
| template <class It> static void initFromInitList(HeaderMap& new_header_map, It begin, It end) { |
Member
There was a problem hiding this comment.
This will need some kind of warning about passing an iterator to keys that are lower cased, otherwise things will break badly. In addition to a warning, add an ASSERT below that the key is lower cased.
Member
Author
There was a problem hiding this comment.
I think that we can reject not lowercased strings when compilation.
aunu53
pushed a commit
to aunu53/envoy
that referenced
this pull request
Jun 4, 2020
Signed-off-by: Shikugawa <rei@tetrate.io> Signed-off-by: Auni Ahsan <auni@google.com>
yashwant121
pushed a commit
to yashwant121/envoy
that referenced
this pull request
Jul 24, 2020
Signed-off-by: Shikugawa <rei@tetrate.io> Signed-off-by: yashwant121 <yadavyashwant36@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Shikugawa rei@tetrate.io
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Commit Message: This PR allows to initialize header map from iterator in addition to the initializer list.
Additional Description: This functionality is needed in wasm extensibility. Now we can extract HeaderMap only to use a function which returns only
std::vector<std::pair<absl::string_view, absl::string_view>>. When we construct the optimized header map from the raw one, we needed to allow iterator to usecreateHeaderMap.Risk Level: Low
Testing: Unit
Docs Changes:
Release Notes:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]