Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: applying route header rules on local replies. #13204

Merged
merged 1 commit into from
Sep 23, 2020

Conversation

alyssawilk
Copy link
Contributor

Commit Message: http: applying route header rules on local replies.
Risk Level: Medium (L7 change)
Testing: updated integration tests
Docs Changes: n/a
Release Notes: inline
Fixes #4317
Runtime Guard: envoy.reloadable_features.always_apply_route_header_rules

@@ -812,7 +812,16 @@ void FilterManager::sendLocalReplyViaFilterChain(
Utility::sendLocalReply(
state_.destroyed_,
Utility::EncodeFunctions{
modify_headers,
[this, modify_headers](ResponseHeaderMap& headers) -> void {
if (streamInfo().route_entry_ &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to make a test for the case where route_entry_ is nullptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

every early response test (invalid HTTP/1.1 sending 400 before we have headers and can select route) tests this. Did you want a unit test as well, or just to make sure we had coverage?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just wanted to make sure we have coverage

@mattklein123 mattklein123 self-assigned this Sep 22, 2020
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for fixing this long standing issue! nice to see the fix be so simple after all of the various refactors in this code path recently.

Comment on lines +859 to +866
if (streamInfo().route_entry_ &&
Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.always_apply_route_header_rules")) {
streamInfo().route_entry_->finalizeResponseHeaders(headers, streamInfo());
}
if (modify_headers) {
modify_headers(headers);
}
Copy link
Member

Choose a reason for hiding this comment

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

This stanza is duplicated verbatim from above and is a little tricky so might be worth de-deduping but up to you.

@alyssawilk alyssawilk merged commit a51bf31 into envoyproxy:master Sep 23, 2020
@mike1808
Copy link

Hello. I'm not familiar with your backport policy and I'm curious if are you going to backport this bug to 1.5?

@alyssawilk
Copy link
Contributor Author

We can cc @envoyproxy/stable-maintainers and ask them what they think!

@PiotrSikora
Copy link
Contributor

Since this is neither security nor stability fix, it doesn't qualify for backporting.
See: https://github.com/envoyproxy/envoy/blob/master/RELEASES.md#stable-releases

@alyssawilk
Copy link
Contributor Author

Right, the question more if we consider it an enhancement, or a bugfix fixing inconsistent header handling.

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.

Envoy doesn't add headers in case of Gateway Timeout
5 participants