Skip to content

[api] Move HeaderMatcher from api.v2.route to type.matcher package#4207

Closed
brirams wants to merge 4 commits intoenvoyproxy:masterfrom
turbinelabs:brirams/#5555/thrift_proxy/move_http_header_matcher
Closed

[api] Move HeaderMatcher from api.v2.route to type.matcher package#4207
brirams wants to merge 4 commits intoenvoyproxy:masterfrom
turbinelabs:brirams/#5555/thrift_proxy/move_http_header_matcher

Conversation

@brirams
Copy link
Copy Markdown
Contributor

@brirams brirams commented Aug 20, 2018

Description:
Since the HeaderMatcher struct is used in a variety of places, it made sense to move it into a common package(as discussed in slack. In doing so, also brought the HeaderUtility class along for the ride by colocating it with common/common/matchers.[cc|h]. Also updated doc references to new location.

Risk Level: Low
Testing: Tests, new and old, pass.
Docs Changes:

  • updated version_history.rst to document move
  • updated references to struct accordingly.

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>
…rences

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>
Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>
k.setCopy(header.key().c_str(), header.key().size());
Http::HeaderString v;
v.setCopy(header.value().c_str(), header.value().size());
static_cast<Http::HeaderMapImpl*>(context)->addViaMove(std::move(k), std::move(v));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to not depend on the common/http package and I believe that means using the HeaderMap interface here -- any objections to changing this to do that?

Copy link
Copy Markdown
Member

@lizan lizan Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can use addCopy in HeaderMap, and pass the HeaderStrings directly from header here, this would avoid one copy above so it would be same. You might want to change the second parameter of addCopy from const string& to absl::string_view so it would avoid copying the value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addCopy takes an Http::LowerCaseString for key have to construct one in a similar way but did change value to be an absl::string_view.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I missed that HeaderString -> LowerCaseString part, then probably it is better to add addViaMove to the interface itself? I would prefer make those change in another PR and get it merged first.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure -- i can definitely do that

…ty to use that

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>
@brirams
Copy link
Copy Markdown
Contributor Author

brirams commented Aug 23, 2018

Serializing this work behind a more higher priority one here: #4239

@stale
Copy link
Copy Markdown

stale bot commented Aug 30, 2018

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Aug 30, 2018
@brirams
Copy link
Copy Markdown
Contributor Author

brirams commented Aug 31, 2018

Working a few higher priority tasks so will be making progress on a slower clip than originally expected. will be moving it forward though so pinging for that.

@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label Aug 31, 2018
@stale
Copy link
Copy Markdown

stale bot commented Sep 7, 2018

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 7, 2018
@brirams
Copy link
Copy Markdown
Contributor Author

brirams commented Sep 7, 2018

just going to close this for now since other things are in flight.

@brirams brirams closed this Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale stalebot believes this issue/PR has not been touched recently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants