From b20abfc11a8361dc65fbb055797ce5094cda4617 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 22 May 2015 01:59:40 +0900 Subject: [PATCH] nghttpx: Allow HTTP Upgrade from POST request if response header was not sent --- src/shrpx_downstream.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 {