diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 9cfa72dd..4e6f16b7 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -252,7 +252,11 @@ void on_frame_recv_callback 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) { // If content-length is missing, // Downstream::push_upload_data_chunk will fail and diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index 26dc3734..466560a4 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -184,7 +184,8 @@ void on_ctrl_recv_callback return; } // 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) { upstream->rst_stream(downstream, SPDYLAY_PROTOCOL_ERROR); return;