envoy
envoy copied to clipboard
Add GetAllHeaders method to golang HTTP filter
Commit Message: Add GetAllHeaders method to golang HTTP filter
Additional Description: Adds a new method which returns a copy of the underlying map[string][]string object which contains all the request headers.
Risk Level: Low
Testing: Unit test
Docs Changes: none required - doesn't change the configuration params of the plugin
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
Hi @willemveerman, welcome and thank you for your contribution.
We will try to review your Pull Request as quickly as possible.
In the meantime, please take a look at the contribution guidelines if you have not done so already.
As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.
Please mark your PR as ready when you want it to be reviewed!
@doujiang24 i think this may be waiting for further review
@doujiang24 i think this may be waiting for further review
I still need to add the tests
@doujiang24 I've added what I think is a test, but I'm not sure how to run the tests - can you shed some light?
@willemveerman Here is a doc section: Testing Envoy with Bazel
For the current ci failure:
compilepkg: missing strict dependencies:
/b/f/w/contrib/golang/filters/http/test/test_data/basic/filter.go: import of "golang.org/x/exp/slices"
https://dev.azure.com/cncf/envoy/_build/results?buildId=170352&view=logs&j=8c169225-0ae8-53bd-947f-07cb81846cb5&t=d1a98671-b7ba-5fbf-f06c-ff337c010df4&l=159
As the error message shows it missing dependency. it would be a easier way to remove such dependency, it might be a bit complicated to introduce a golang dependency in bazel.
~@doujiang24 OK, it's ready for review now~
Actually, I'm just going to improve the tests a little
OK I've added one further test to cover the case of the headerMap being changed, in order to verify that the slices are being copied. Sorry for delay, I had a hard time building the tests on my m2 arm, but found a workaround. @doujiang24