From 98fb4298868ae12bc618d5fdb46241c801192983 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Mon, 27 Aug 2018 11:07:54 -0700 Subject: [PATCH 1/2] mixer: clear route cache on header update Signed-off-by: Kuat Yessenov --- src/envoy/http/mixer/filter.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/envoy/http/mixer/filter.cc b/src/envoy/http/mixer/filter.cc index 1361c925770..3aeabc62a2c 100644 --- a/src/envoy/http/mixer/filter.cc +++ b/src/envoy/http/mixer/filter.cc @@ -245,6 +245,7 @@ void Filter::completeCheck(const CheckResponseInfo& info) { if (nullptr != headers_) { UpdateHeaders(*headers_, route_directive_.request_header_operations()); headers_ = nullptr; + decoder_callbacks_->clearRouteCache(); } if (!initiating_call_) { From 6cd522adb528ac8a8a399bfc6e6b8a36d252db26 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Tue, 28 Aug 2018 15:52:58 -0700 Subject: [PATCH 2/2] check size Signed-off-by: Kuat Yessenov --- src/envoy/http/mixer/filter.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/envoy/http/mixer/filter.cc b/src/envoy/http/mixer/filter.cc index 3aeabc62a2c..54bef4c4b28 100644 --- a/src/envoy/http/mixer/filter.cc +++ b/src/envoy/http/mixer/filter.cc @@ -245,7 +245,9 @@ void Filter::completeCheck(const CheckResponseInfo& info) { if (nullptr != headers_) { UpdateHeaders(*headers_, route_directive_.request_header_operations()); headers_ = nullptr; - decoder_callbacks_->clearRouteCache(); + if (route_directive_.request_header_operations().size() > 0) { + decoder_callbacks_->clearRouteCache(); + } } if (!initiating_call_) {