Commit 0b484482 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: RST_STREAM for invalid request header values

parent 2a56a3d9
......@@ -179,19 +179,10 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
return 0;
}
if (!nghttp2_check_header_name(name, namelen)) {
// we are not forgiving for malformed header field name in
// request.
if (!http2::check_nv(name, namelen, value, valuelen)) {
upstream->rst_stream(downstream, NGHTTP2_PROTOCOL_ERROR);
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
}
if (!nghttp2_check_header_value(value, valuelen)) {
return 0;
}
if (!http2::check_nv(name, namelen, value, valuelen)) {
// Simply discard name/value, as if it never happen.
return 0;
}
auto token = http2::lookup_token(name, namelen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment