-
Notifications
You must be signed in to change notification settings - Fork 89
Update Envoy to f95f5391b0b8683081ec786ea946026594955fc6 #562
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
Changes from all commits
1a08d1d
e717c91
49106b6
dc0b618
6136e81
30d7f20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,17 +13,23 @@ FilterConfigurationBase::FilterConfigurationBase( | |
|
|
||
| void FilterConfigurationBase::computeEffectiveConfiguration( | ||
| const Envoy::Http::RequestHeaderMap& headers) { | ||
| const auto* request_config_header = headers.get(TestServer::HeaderNames::get().TestServerConfig); | ||
| if (request_config_header) { | ||
| const auto& request_config_header = headers.get(TestServer::HeaderNames::get().TestServerConfig); | ||
| if (request_config_header.size() == 1) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we have an else condition here now? again, taking into consideration receiving more than 1
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you're right. Done in dc0b618 + explicit tests for the case. |
||
| // We could be more flexible and look for the first request header that has a value, | ||
| // but without a proper understanding of a real use case for that, we are assuming that any | ||
| // existence of duplicate headers here is an error. | ||
| nighthawk::server::ResponseOptions response_options = *server_config_; | ||
| std::string error_message; | ||
| if (Configuration::mergeJsonConfig(request_config_header->value().getStringView(), | ||
| if (Configuration::mergeJsonConfig(request_config_header[0]->value().getStringView(), | ||
| response_options, error_message)) { | ||
| effective_config_ = | ||
| std::make_shared<const nighthawk::server::ResponseOptions>(std::move(response_options)); | ||
| } else { | ||
| effective_config_ = absl::InvalidArgumentError(error_message); | ||
| } | ||
| } else if (request_config_header.size() > 1) { | ||
| effective_config_ = absl::InvalidArgumentError( | ||
| "Received multiple configuration headers in the request, expected only one."); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the first instance where us just using envoy's .bazelrc isn't great for us. No action required here on this PR, but we should keep an eye on it.