From c139ff1d049ed8b17cc07b9723586c3b27e5811d Mon Sep 17 00:00:00 2001 From: Erica Manno Date: Thu, 9 Jul 2020 15:05:23 +0200 Subject: [PATCH] Format code Signed-off-by: Erica Manno --- include/envoy/http/codec.h | 3 ++- source/common/http/utility.cc | 6 ++++-- source/common/http/utility.h | 6 +++--- .../network/http_connection_manager/config.cc | 4 ++-- test/common/http/utility_test.cc | 12 ++++++++---- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/include/envoy/http/codec.h b/include/envoy/http/codec.h index 84efd256af9c..3fec74335da1 100644 --- a/include/envoy/http/codec.h +++ b/include/envoy/http/codec.h @@ -144,7 +144,8 @@ class ResponseEncoder : public virtual StreamEncoder { virtual void encodeTrailers(const ResponseTrailerMap& trailers) PURE; /** - * Indicates whether invalid HTTP messaging should be handled with a stream error or a connection error. + * Indicates whether invalid HTTP messaging should be handled with a stream error or a connection + * error. */ virtual absl::optional streamErrorOnInvalidHttpMessage() PURE; }; diff --git a/source/common/http/utility.cc b/source/common/http/utility.cc index 5083c3ecd653..dc40a5d19076 100644 --- a/source/common/http/utility.cc +++ b/source/common/http/utility.cc @@ -19,6 +19,7 @@ #include "common/http/header_map_impl.h" #include "common/http/headers.h" #include "common/http/message_impl.h" +#include "common/http/utility.h" #include "common/network/utility.h" #include "common/protobuf/utility.h" @@ -407,8 +408,9 @@ Utility::parseHttp1Settings(const envoy::config::core::v3::Http1ProtocolOptions& return ret; } -bool Utility::streamErrorOnInvalidHttpMessageForHttp1(bool hcm_stream_error_on_invalid_http_message, - const absl::optional& override_stream_error_on_invalid_http_message) { +bool Utility::streamErrorOnInvalidHttpMessageForHttp1( + bool hcm_stream_error_on_invalid_http_message, + const absl::optional& override_stream_error_on_invalid_http_message) { if (override_stream_error_on_invalid_http_message.has_value()) { return override_stream_error_on_invalid_http_message.value(); } else { diff --git a/source/common/http/utility.h b/source/common/http/utility.h index 4794e6697ba8..fc0f269e16c7 100644 --- a/source/common/http/utility.h +++ b/source/common/http/utility.h @@ -265,9 +265,9 @@ bool isWebSocketUpgradeRequest(const RequestHeaderMap& headers); */ Http1Settings parseHttp1Settings(const envoy::config::core::v3::Http1ProtocolOptions& config); -bool streamErrorOnInvalidHttpMessageForHttp1( - const bool hcm_stream_error_on_invalid_http_message, - const absl::optional& override_stream_error_on_invalid_http_message); +bool streamErrorOnInvalidHttpMessageForHttp1( + const bool hcm_stream_error_on_invalid_http_message, + const absl::optional& override_stream_error_on_invalid_http_message); struct EncodeFunctions { // Function to rewrite locally generated response. diff --git a/source/extensions/filters/network/http_connection_manager/config.cc b/source/extensions/filters/network/http_connection_manager/config.cc index 38298c7b3409..700723797132 100644 --- a/source/extensions/filters/network/http_connection_manager/config.cc +++ b/source/extensions/filters/network/http_connection_manager/config.cc @@ -1,5 +1,3 @@ -#include "extensions/filters/network/http_connection_manager/config.h" - #include #include #include @@ -33,6 +31,8 @@ #include "common/tracing/http_tracer_config_impl.h" #include "common/tracing/http_tracer_manager_impl.h" +#include "extensions/filters/network/http_connection_manager/config.h" + namespace Envoy { namespace Extensions { namespace NetworkFilters { diff --git a/test/common/http/utility_test.cc b/test/common/http/utility_test.cc index d8f834a1da86..f7241d1a9d7c 100644 --- a/test/common/http/utility_test.cc +++ b/test/common/http/utility_test.cc @@ -359,20 +359,24 @@ TEST(HttpUtility, ValidateStreamErrorsWithHcmForHttp1) { // If the override value is present, it will take precedence over the HCM value. bool hcm_stream_error = false; absl::optional override_stream_error = true; - EXPECT_TRUE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, override_stream_error)); + EXPECT_TRUE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, + override_stream_error)); hcm_stream_error = true; override_stream_error = false; - EXPECT_FALSE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, override_stream_error)); + EXPECT_FALSE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, + override_stream_error)); // If the override value is not set, the HCM value will be used. hcm_stream_error = false; override_stream_error.reset(); - EXPECT_FALSE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, override_stream_error)); + EXPECT_FALSE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, + override_stream_error)); hcm_stream_error = true; override_stream_error.reset(); - EXPECT_TRUE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, override_stream_error)); + EXPECT_TRUE(Http::Utility::streamErrorOnInvalidHttpMessageForHttp1(hcm_stream_error, + override_stream_error)); } TEST(HttpUtility, getLastAddressFromXFF) {