Skip to content

Commit

Permalink
http inspector: rename h2 to h2c (#8227)
Browse files Browse the repository at this point in the history
Description: Rename h2 to h2c to respect the standard
Risk Level: Low
Testing: Unit test
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: crazyxy <yxyan@google.com>
  • Loading branch information
yxue authored and lizan committed Sep 17, 2019
1 parent a381bc4 commit 8c28a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ void Filter::done(bool success) {
} else {
ASSERT(protocol_ == "HTTP/2");
config_->stats().http2_found_.inc();
protocol = "h2";
// h2 HTTP/2 over TLS, h2c HTTP/2 over TCP
// TODO(yxue): use detected protocol from http inspector and support h2c token in HCM
protocol = "h2c";
}

cb_->socket().setRequestedApplicationProtocols({protocol});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ TEST_F(HttpInspectorTest, InspectHttp2) {
return Api::SysCallSizeResult{ssize_t(data.size()), 0};
}));

const std::vector<absl::string_view> alpn_protos{absl::string_view("h2")};
const std::vector<absl::string_view> alpn_protos{absl::string_view("h2c")};

EXPECT_CALL(socket_, setRequestedApplicationProtocols(alpn_protos));
EXPECT_CALL(cb_, continueFilterChain(true));
Expand Down Expand Up @@ -240,7 +240,7 @@ TEST_F(HttpInspectorTest, ReadError) {
TEST_F(HttpInspectorTest, MultipleReadsHttp2) {

init();
const std::vector<absl::string_view> alpn_protos = {absl::string_view("h2")};
const std::vector<absl::string_view> alpn_protos = {absl::string_view("h2c")};

const std::string header =
"505249202a20485454502f322e300d0a0d0a534d0d0a0d0a00000c04000000000000041000000000020000000000"
Expand Down

0 comments on commit 8c28a4f

Please sign in to comment.