File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
driver/src/main/java/oracle/nosql/driver/httpclient Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,10 @@ private HttpClient(String host,
233233 httpProtocols :
234234 new ArrayList <>(Arrays .asList (ApplicationProtocolNames .HTTP_2 , ApplicationProtocolNames .HTTP_1_1 ));
235235
236- this .httpFallbackProtocol = this .httpProtocols .get (this .httpProtocols .size () - 1 );
236+ // If Http1.1 is in the httpProtocols list, we prefer use it as the fallback
237+ // Else we use the last protocol in the httpProtocols list.
238+ this .httpFallbackProtocol = this .httpProtocols .contains (ApplicationProtocolNames .HTTP_1_1 ) ?
239+ ApplicationProtocolNames .HTTP_1_1 : this .httpProtocols .get (this .httpProtocols .size () - 1 );
237240
238241 this .maxContentLength = (maxContentLength == 0 ?
239242 DEFAULT_MAX_CONTENT_LENGTH : maxContentLength );
You can’t perform that action at this time.
0 commit comments