Updates Http2VisitorInterface::OnHeaderForStream() to return a boolean. This is necessary in order to communicate when header names or values are invalid.
This change adds a test that exercises nghttp2 header validation. (Specifically, the case of an invalid trailing header name.)
This change also adds the following behavior for the OG stack, for client endpoints:
* Closes a stream that receives END_STREAM and is half-closed local.
PiperOrigin-RevId: 380816879
diff --git a/http2/adapter/http2_visitor_interface.h b/http2/adapter/http2_visitor_interface.h
index a7e34e9..8e621e4 100644
--- a/http2/adapter/http2_visitor_interface.h
+++ b/http2/adapter/http2_visitor_interface.h
@@ -83,8 +83,10 @@
// Called when the connection receives the header |key| and |value| for a
// stream. The HTTP/2 pseudo-headers defined in RFC 7540 Sections 8.1.2.3 and
// 8.1.2.4 are also conveyed in this callback. This method is called after
- // OnBeginHeadersForStream().
- virtual void OnHeaderForStream(Http2StreamId stream_id, absl::string_view key,
+ // OnBeginHeadersForStream(). Should return "false" to indicate that the
+ // header name or value should be rejected. This will cause the HTTP
+ // transaction to fail.
+ virtual bool OnHeaderForStream(Http2StreamId stream_id, absl::string_view key,
absl::string_view value) = 0;
// Called when the connection has received the complete header block for a