nghttpx: Check frame type in HTTP/2 backend on_begin_headers_callback

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-02 00:53:48 +09:00
parent cf5ac0f363
commit 4de8db523f
1 changed files with 2 additions and 1 deletions

View File

@ -700,7 +700,8 @@ namespace {
int on_begin_headers_callback(nghttp2_session *session,
const nghttp2_frame *frame, void *user_data) {
auto http2session = static_cast<Http2Session *>(user_data);
if (frame->headers.cat != NGHTTP2_HCAT_RESPONSE) {
if (frame->hd.type != NGHTTP2_HEADERS ||
frame->headers.cat != NGHTTP2_HCAT_RESPONSE) {
return 0;
}
auto sd = static_cast<StreamData *>(