Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ message HttpConnectionManager {

// An optional override that the connection manager will write to the server
// header in responses. If not set, the default is *envoy*.
string server_name = 10;
string server_name = 10
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];

// Defines the action to be applied to the Server header on the response path.
// By default, Envoy will overwrite the header with the value specified in
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ stat_prefix: router
"Didn't find a registered implementation for name: 'foo'");
}

TEST_F(HttpConnectionManagerConfigTest, InvalidServerName) {
const std::string yaml_string = R"EOF(
server_name: >
foo
route_config:
name: local_route
stat_prefix: router
)EOF";

EXPECT_THROW(createHttpConnectionManagerConfig(yaml_string), ProtoValidationException);
}

TEST_F(HttpConnectionManagerConfigTest, RouterInverted) {
const std::string yaml_string = R"EOF(
codec_type: http1
Expand Down