File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,16 @@ void HttpClientImpl::createTcpClient()
7373 {
7474 // send request;
7575 LOG_TRACE << " Connection established!" ;
76+ static bool disableHttp2 = []() {
77+ const char *env = std::getenv (" DROGON_DISABLE_HTTP2_CLIENT" );
78+ if (env != nullptr && std::string (env) == " 1" )
79+ {
80+ LOG_WARN << " HTTP/2 client disabled by environment "
81+ " variable DROGON_DISABLE_HTTP2_CLIENT" ;
82+ return true ;
83+ }
84+ return false ;
85+ }();
7686
7787 auto protocol = connPtr->applicationProtocol ();
7888 if (protocol == " http/1.1" )
@@ -85,7 +95,7 @@ void HttpClientImpl::createTcpClient()
8595 &thisPtr->bytesReceived_ );
8696 thisPtr->httpVersion_ = Version::kHttp11 ;
8797 }
88- else if (protocol == " h2" )
98+ else if (protocol == " h2" && !disableHttp2 )
8999 {
90100 LOG_TRACE << " Select http/2 protocol" ;
91101 thisPtr->transport_ =
You can’t perform that action at this time.
0 commit comments