From b0eb7b0d4b75433a596fb564dc3dc28d7ba9680b Mon Sep 17 00:00:00 2001 From: Wayne Zhang Date: Tue, 7 Mar 2017 11:43:42 -0800 Subject: [PATCH] Not call report if decodeHeaders is not called. --- src/envoy/mixer/http_filter.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/envoy/mixer/http_filter.cc b/src/envoy/mixer/http_filter.cc index c59f5f43eea..6a8da6a6f45 100644 --- a/src/envoy/mixer/http_filter.cc +++ b/src/envoy/mixer/http_filter.cc @@ -242,6 +242,8 @@ class Instance : public Http::StreamFilter, public Http::AccessLog::Instance { const HeaderMap* response_headers, const AccessLog::RequestInfo& request_info) override { Log().debug("Called Mixer::Instance : {}", __func__); + // If decodeHaeders() is not called, not to call Mixer report. + if (!request_data_) return; // Make sure not to use any class members at the callback. // The class may be gone when it is called. // Log() is a static function so it is OK.