Skip to content

router: add REQ(header-name) header formatter#8782

Merged
zuercher merged 12 commits intoenvoyproxy:masterfrom
ascheglov:feature/add_req_to_additional_resp_headers
Nov 7, 2019
Merged

router: add REQ(header-name) header formatter#8782
zuercher merged 12 commits intoenvoyproxy:masterfrom
ascheglov:feature/add_req_to_additional_resp_headers

Conversation

@ascheglov
Copy link
Copy Markdown
Contributor

request_headers_to_add and response_headers_to_add can now use "%REQ(header-name)%"

Use cases:

  • rename a request header:
    request_headers_to_remove:
    - x-header
    request_headers_to_add:
    - header:
        key: x-new-name
        value: "%REQ(x-header)%"
  • echo a request header, including envoy-generated headers:
    response_headers_to_add:
    - header:
        key: x-header-echo
        value: "%REQ(x-header)%"
    - header:
        key: x-request-id
        value: "%REQ(x-request-id)%"

Risk Level: low
Testing: unit tests
Doc Changes: yes
Release Notes: yes
Fixes #8683

Risk Level: low
Testing: unit tests
Doc Changes: yes
Release Notes: yes
Fixes envoyproxy#8683

Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
Copy link
Copy Markdown
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

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

Thanks! I have some comments, but I think this will be a nice feature to have.

@zuercher
Copy link
Copy Markdown
Member

Also there's an implementation of StreamInfo in test/common/stream_info/test_util.h that needs to be updated.

Anatoly Scheglov added 4 commits October 31, 2019 00:02
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
@zuercher
Copy link
Copy Markdown
Member

I think if you merge master, the coverage test will stop failing. There were a few commits to increase coverage not long after you branched.

Anatoly Scheglov added 4 commits November 1, 2019 13:52
…o_additional_resp_headers

Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
zuercher
zuercher previously approved these changes Nov 1, 2019
Copy link
Copy Markdown
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

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

Thanks!

@dio can you have a look as well?

zuercher
zuercher previously approved these changes Nov 5, 2019
Copy link
Copy Markdown
Member

@dio dio left a comment

Choose a reason for hiding this comment

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

Awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: ability to use x-request-id in response_headers_to_add

3 participants