nghttpd: Issue RST_STREAM if received header field contains invalid chars

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-15 22:45:18 +09:00
parent b0078a2379
commit 22e41bab3f
1 changed files with 4 additions and 1 deletions

View File

@ -1022,8 +1022,11 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
if (!stream) {
return 0;
}
if (!http2::check_nv(name, namelen, value, valuelen)) {
return 0;
nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, frame->hd.stream_id,
NGHTTP2_PROTOCOL_ERROR);
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
}
auto token = http2::lookup_token(name, namelen);