Commit 358d12a8 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Fix bug CONNECT does not work

parent b8a01f52
...@@ -252,7 +252,11 @@ void on_frame_recv_callback ...@@ -252,7 +252,11 @@ void on_frame_recv_callback
break; break;
} }
} }
if((frame->hd.flags & NGHTTP2_FLAG_END_STREAM) == 0 && if(!bad_req &&
!util::strieq("CONNECT",
nva[req_hdidx[1]].value,
nva[req_hdidx[1]].valuelen) &&
(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) == 0 &&
req_hdidx[4] == -1) { req_hdidx[4] == -1) {
// If content-length is missing, // If content-length is missing,
// Downstream::push_upload_data_chunk will fail and // Downstream::push_upload_data_chunk will fail and
......
...@@ -184,7 +184,8 @@ void on_ctrl_recv_callback ...@@ -184,7 +184,8 @@ void on_ctrl_recv_callback
return; return;
} }
// Require content-length if FIN flag is not set. // Require content-length if FIN flag is not set.
if((frame->syn_stream.hd.flags & SPDYLAY_CTRL_FLAG_FIN) == 0 && if(!util::strieq("CONNECT", method) &&
(frame->syn_stream.hd.flags & SPDYLAY_CTRL_FLAG_FIN) == 0 &&
!content_length) { !content_length) {
upstream->rst_stream(downstream, SPDYLAY_PROTOCOL_ERROR); upstream->rst_stream(downstream, SPDYLAY_PROTOCOL_ERROR);
return; return;
......
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