diff --git a/test/common/http/http2/codec_impl_test.cc b/test/common/http/http2/codec_impl_test.cc index c70503507ea0..70d2bd7266ea 100644 --- a/test/common/http/http2/codec_impl_test.cc +++ b/test/common/http/http2/codec_impl_test.cc @@ -4448,18 +4448,29 @@ TEST_P(Http2CodecImplTest, CheckHeaderValueValidation) { scoped_runtime_.mergeValues({{"envoy.reloadable_features.validate_upstream_headers", "false"}}); stream_error_on_invalid_http_messaging_ = true; initialize(); + +#ifdef ENVOY_ENABLE_UHV + // UHV does not appear to reject some header value chars. if (http2_implementation_ == Http2Impl::Oghttp2) { - // oghttp2 fails this test for now. - return; + GTEST_SKIP(); } +#endif // Change one character in the header value and verify that codec correctly // accepts or rejects based on the table above. std::string header_value{"aaaaaaaa"}; for (int i = 0; i <= 0xff; ++i) { + if (i == 0 && http2_implementation_ == Http2Impl::Oghttp2) { + // oghttp2 fails this specific case for now. + continue; + } + TestRequestHeaderMapImpl request_headers; HttpTestUtility::addDefaultHeaders(request_headers); header_value[2] = static_cast(i); + + SCOPED_TRACE(absl::StrCat("header value: [", absl::CEscape(header_value), "]")); + HeaderString header_string("a"); setHeaderStringUnvalidated(header_string, header_value); request_headers.addViaMove(HeaderString(absl::string_view("foo")), std::move(header_string));