Skip to content

Commit

Permalink
Update boolean naming
Browse files Browse the repository at this point in the history
  • Loading branch information
davidh44 committed Feb 3, 2025
1 parent e799151 commit ed58871
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public final class NettyNioAsyncHttpClient implements SdkAsyncHttpClient {
private final SdkChannelPoolMap<URI, ? extends SdkChannelPool> pools;
private final NettyConfiguration configuration;
private final ProtocolNegotiation protocolNegotiation;
private boolean userSetAlpn;
private boolean isAlpnUserConfigured;

private NettyNioAsyncHttpClient(DefaultBuilder builder, AttributeMap serviceDefaultsMap) {
this.configuration = new NettyConfiguration(serviceDefaultsMap);
Expand Down Expand Up @@ -137,7 +137,7 @@ public CompletableFuture<Void> execute(AsyncExecuteRequest request) {

private void failIfAlpnUsedWithHttp(AsyncExecuteRequest request) {
if ("http".equals(request.request().protocol())) {
if (userSetAlpn) {
if (isAlpnUserConfigured) {
throw new UnsupportedOperationException("ALPN can only be used with HTTPS, not HTTP.");
}
if (protocolNegotiation == ProtocolNegotiation.ALPN) {
Expand Down Expand Up @@ -189,7 +189,7 @@ private SslProvider resolveSslProvider(DefaultBuilder builder) {
private ProtocolNegotiation resolveProtocolNegotiation(ProtocolNegotiation userSetValue, AttributeMap serviceDefaultsMap,
Protocol protocol, SslProvider sslProvider) {
if (userSetValue == ProtocolNegotiation.ALPN) {
this.userSetAlpn = true;
this.isAlpnUserConfigured = true;
// TODO - remove once we implement support for ALPN with HTTP1
if (protocol == Protocol.HTTP1_1) {
throw new UnsupportedOperationException("ALPN with HTTP/1.1 is not yet supported, use prior knowledge instead "
Expand Down

0 comments on commit ed58871

Please sign in to comment.