Filter http2 headers
When using aggregation with http2, :authority headers were getting
forwarded to the client, which didn't know how to deal with them on
http1.
Filter all http2 headers.
Tested: Unit tests pass.
Change-Id: I6a834656b604004eeba1a2aa2f245ef211f28495
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/http/http2_connection.hpp b/http/http2_connection.hpp
index d394889..df41ff6 100644
--- a/http/http2_connection.hpp
+++ b/http/http2_connection.hpp
@@ -483,9 +483,11 @@
}
thisReq.method(verb);
}
- else if (nameSv == ":scheme")
+ else if (nameSv.starts_with(":"))
{
- // Nothing to check on scheme
+ // Ignore all other http2 headers
+ // :scheme and :authority are other valid http2 fields that might
+ // show up here.
}
else
{
diff --git a/test/http/http2_connection_test.cpp b/test/http/http2_connection_test.cpp
index 9c36a43..0fb0de6 100644
--- a/test/http/http2_connection_test.cpp
+++ b/test/http/http2_connection_test.cpp
@@ -54,7 +54,6 @@
"curl/8.5.0");
EXPECT_EQ(req->getHeaderValue(boost::beast::http::field::accept),
"*/*");
- EXPECT_EQ(req->getHeaderValue(":authority"), "localhost:18080");
asyncResp->res.write("StringOutput");
}
};