diff --git a/src/shrpx_downstream.cc b/src/shrpx_downstream.cc index 60428783..6b7f4a0e 100644 --- a/src/shrpx_downstream.cc +++ b/src/shrpx_downstream.cc @@ -972,8 +972,9 @@ bool Downstream::get_upgraded() const { return upgraded_; } bool Downstream::get_upgrade_request() const { return upgrade_request_; } bool Downstream::get_http2_upgrade_request() const { - return request_bodylen_ == 0 && http2_upgrade_seen_ && - request_hdidx_[http2::HD_HTTP2_SETTINGS] != -1; + return http2_upgrade_seen_ && + request_hdidx_[http2::HD_HTTP2_SETTINGS] != -1 && + response_state_ == INITIAL; } namespace {