nghttp: Check HTTP header field characters
This commit is contained in:
parent
9fb2bc8468
commit
e6695d9ba7
|
@ -1252,6 +1252,13 @@ int on_header_callback(nghttp2_session *session,
|
|||
verbose_on_header_callback(session, frame, name, namelen, value, valuelen,
|
||||
flags, user_data);
|
||||
}
|
||||
|
||||
if(!http2::check_nv(name, namelen, value, valuelen)) {
|
||||
nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, frame->hd.stream_id,
|
||||
NGHTTP2_PROTOCOL_ERROR);
|
||||
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
|
||||
}
|
||||
|
||||
switch(frame->hd.type) {
|
||||
case NGHTTP2_HEADERS: {
|
||||
if(frame->headers.cat != NGHTTP2_HCAT_RESPONSE &&
|
||||
|
|
Loading…
Reference in New Issue