Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/envoy/mixer/http_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,29 @@ class Instance : public Http::StreamDecoderFilter,

// mixer control switch (off by default)
bool mixer_disabled() {
auto route = decoder_callbacks_->route()->routeEntry();
auto route = decoder_callbacks_->route();
if (route != nullptr) {
auto key = route->opaqueConfig().find(kJsonNameMixerSwitch);
if (key != route->opaqueConfig().end() && key->second == "on") {
return false;
auto entry = route->routeEntry();
if (entry != nullptr) {
auto key = entry->opaqueConfig().find(kJsonNameMixerSwitch);
if (key != entry->opaqueConfig().end() && key->second == "on") {
return false;
}
}
}
return true;
}

// attribute forward switch (on by default)
bool forward_disabled() {
auto route = decoder_callbacks_->route()->routeEntry();
auto route = decoder_callbacks_->route();
if (route != nullptr) {
auto key = route->opaqueConfig().find(kJsonNameForwardSwitch);
if (key != route->opaqueConfig().end() && key->second == "off") {
return true;
auto entry = route->routeEntry();
if (entry != nullptr) {
auto key = entry->opaqueConfig().find(kJsonNameForwardSwitch);
if (key != entry->opaqueConfig().end() && key->second == "off") {
return true;
}
}
}
return false;
Expand Down