nghttpx: Treat malformed request as PROTOCOL_ERROR

This commit is contained in:
Tatsuhiro Tsujikawa 2014-08-08 23:11:58 +09:00
parent 704bbbfcaa
commit 88add854ff
1 changed files with 3 additions and 9 deletions

View File

@ -314,9 +314,7 @@ int on_request_headers(Http2Upstream *upstream,
}
if(!http2::check_http2_request_headers(nva)) {
if(upstream->error_reply(downstream, 400) != 0) {
upstream->rst_stream(downstream, NGHTTP2_PROTOCOL_ERROR);
}
return 0;
}
@ -336,9 +334,7 @@ int on_request_headers(Http2Upstream *upstream,
// Here we strictly require :authority header field.
if(scheme || path || !having_authority) {
if(upstream->error_reply(downstream, 400) != 0) {
upstream->rst_stream(downstream, NGHTTP2_PROTOCOL_ERROR);
}
return 0;
}
@ -351,9 +347,7 @@ int on_request_headers(Http2Upstream *upstream,
(!get_config()->http2_proxy && !having_authority && !having_host) ||
!http2::non_empty_value(path)) {
if(upstream->error_reply(downstream, 400) != 0) {
upstream->rst_stream(downstream, NGHTTP2_PROTOCOL_ERROR);
}
return 0;
}