HTTP/3: adjusted control stream parsing.

7.2.1:
   If a DATA frame is received on a control stream, the recipient MUST
   respond with a connection error of type H3_FRAME_UNEXPECTED;

7.2.2:
   If a HEADERS frame is received on a control stream, the recipient MUST
   respond with a connection error (Section 8) of type H3_FRAME_UNEXPECTED.
This commit is contained in:
Vladimir Homutov 2021-04-22 13:49:18 +03:00
parent 013880bbda
commit a8acca865b

View File

@ -1069,6 +1069,10 @@ ngx_http_v3_parse_control(ngx_connection_t *c, void *data, u_char ch)
st->state = sw_max_push_id; st->state = sw_max_push_id;
break; break;
case NGX_HTTP_V3_FRAME_DATA:
case NGX_HTTP_V3_FRAME_HEADERS:
return NGX_HTTP_V3_ERR_FRAME_UNEXPECTED;
default: default:
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http3 parse skip unknown frame"); "http3 parse skip unknown frame");