Skip to content

Commit

Permalink
Add new constant with default transport channel types
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Nov 27, 2023
1 parent 87168a3 commit fb3b091
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Set;
import javax.net.ssl.SSLPeerUnverifiedException;

import org.apache.logging.log4j.LogManager;
Expand Down Expand Up @@ -55,6 +56,8 @@ public class SecuritySSLRequestHandler<T extends TransportRequest> implements Tr
private final SslExceptionHandler errorHandler;
private final SSLConfig SSLConfig;

private static final Set<String> DEFAULT_CHANNEL_TYPES = Set.of("direct", "transport");

public SecuritySSLRequestHandler(
String action,
TransportRequestHandler<T> actualHandler,
Expand Down Expand Up @@ -87,7 +90,7 @@ public final void messageReceived(T request, TransportChannel channel, Task task
ThreadContext threadContext = getThreadContext();

String channelType = channel.getChannelType();
if (!channelType.equals("direct") && !channelType.equals("transport")) {
if (!DEFAULT_CHANNEL_TYPES.contains(channelType)) {
channel = getInnerChannel(channel);
}

Expand Down

0 comments on commit fb3b091

Please sign in to comment.