Skip to content

Fix header-to-metadata if clause#11747

Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
nahratzah:fix_htm_if_clause
Jun 30, 2020
Merged

Fix header-to-metadata if clause#11747
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
nahratzah:fix_htm_if_clause

Conversation

@nahratzah
Copy link
Contributor

Commit Message: Bugfix header-to-metadata: don't execute on-header-missing clause when header is present
Additional Description: The else-clause would trip when the on-header-present block was absent, irrespective of if the header was actually absent.
Risk Level: Low
Testing: Introduced unit test to cover this case.
Docs Changes: N/A
Release Notes: N/A

@nahratzah nahratzah requested a review from zuercher as a code owner June 25, 2020 13:47
@nahratzah nahratzah force-pushed the fix_htm_if_clause branch from 9193267 to 8a88879 Compare June 25, 2020 13:54
Ariane van der Steldt added 2 commits June 25, 2020 14:55
Signed-off-by: Ariane van der Steldt <avandersteldt@slack-corp.com>
Without the fix, the `on-header-missing` branch would be executed,
if the `on-header-present` case is absent, regardless of wether
the header was actually absent.

Signed-off-by: Ariane van der Steldt <avandersteldt@slack-corp.com>
type: STRING
)EOF";
initializeFilter(config);
Http::TestRequestHeaderMapImpl headers{{"x-version", ""}};
Copy link
Member

Choose a reason for hiding this comment

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

nit: add value to the header (to avoid conflating with the internal handling of headers without a value).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the PR. <3

@rgs1
Copy link
Member

rgs1 commented Jun 25, 2020

@nahratzah thank you -- looks good to me. Left a small nit.

@zuercher zuercher self-assigned this Jun 25, 2020
Signed-off-by: Ariane van der Steldt <avandersteldt@slack-corp.com>
rgs1
rgs1 previously approved these changes Jun 25, 2020
Copy link
Member

@rgs1 rgs1 left a comment

Choose a reason for hiding this comment

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

thank you!

zuercher
zuercher previously approved these changes Jun 25, 2020
Copy link
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.

Thank you!

@zuercher
Copy link
Member

Seems we're blocked on #11758. Presuming the fix (#11760) works, we'll need to merge master once it's been merged.

@zuercher
Copy link
Member

@nahratzah I think if you merge upstream master, the broken test in tsan should pass and we can get this merged.

@rgs1
Copy link
Member

rgs1 commented Jun 26, 2020

Note that #11698 is ready for landing 😄 Which means you'd have to merge + resolve conflicts. But I am happy to do it there if this one lands first.

@nahratzah nahratzah dismissed stale reviews from zuercher and rgs1 via 3209562 June 26, 2020 20:34
@mattklein123 mattklein123 merged commit 078fd7d into envoyproxy:master Jun 30, 2020
aimless404 pushed a commit to aimless404/envoy that referenced this pull request Jun 30, 2020
The else-clause would trip when the on-header-present block was absent, irrespective of if the header was actually absent.

Signed-off-by: Ariane van der Steldt <avandersteldt@slack-corp.com>
Signed-off-by: Yifan Yang <needyyang@google.com>
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.

4 participants