nghttp: Check HTTP header field characters

This commit is contained in:
Tatsuhiro Tsujikawa 2014-08-07 22:01:00 +09:00
parent 9fb2bc8468
commit e6695d9ba7
1 changed files with 7 additions and 0 deletions

View File

@ -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 &&