Browse Source
http2: ignore invalid headers explicitly
Required in order for `parallel/test-http2-response-splitting` to pass
after upgrading `nghttp2`.
PR-URL: https://github.com/nodejs/node/pull/14955
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
canary-base
Anna Henningsen
7 years ago
No known key found for this signature in database
GPG Key ID: D8B9F5AEAE84E4CF
2 changed files with
18 additions and
0 deletions
src/node_http2_core-inl.h
src/node_http2_core.h
@ -140,6 +140,16 @@ inline int Nghttp2Session::OnFrameNotSent(nghttp2_session *session,
return 0 ;
}
inline int Nghttp2Session : : OnInvalidHeader ( nghttp2_session * session ,
const nghttp2_frame * frame ,
nghttp2_rcbuf * name ,
nghttp2_rcbuf * value ,
uint8_t flags ,
void * user_data ) {
// Ignore invalid header fields by default.
return 0 ;
}
// Called when nghttp2 closes a stream, either in response to an RST_STREAM
// frame or the stream closing naturally on it's own
inline int Nghttp2Session : : OnStreamClose ( nghttp2_session * session ,
@ -910,6 +920,8 @@ Nghttp2Session::Callbacks::Callbacks(bool kHasGetPaddingCallback) {
callbacks , OnDataChunkReceived ) ;
nghttp2_session_callbacks_set_on_frame_not_send_callback (
callbacks , OnFrameNotSent ) ;
nghttp2_session_callbacks_set_on_invalid_header_callback2 (
callbacks , OnInvalidHeader ) ;
# ifdef NODE_DEBUG_HTTP2
nghttp2_session_callbacks_set_error_callback (
@ -240,6 +240,12 @@ class Nghttp2Session {
int32_t id ,
uint32_t code ,
void * user_data ) ;
static inline int OnInvalidHeader ( nghttp2_session * session ,
const nghttp2_frame * frame ,
nghttp2_rcbuf * name ,
nghttp2_rcbuf * value ,
uint8_t flags ,
void * user_data ) ;
static inline int OnDataChunkReceived ( nghttp2_session * session ,
uint8_t flags ,
int32_t id ,