Skip to content

Commit

Permalink
Add XdsNameResolver.getHeaderValue() not null check
Browse files Browse the repository at this point in the history
  • Loading branch information
skyguard1 committed Aug 6, 2021
1 parent 9398147 commit 3e1455f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xds/src/main/java/io/grpc/xds/CdsLoadBalancer2.java
Expand Up @@ -185,7 +185,7 @@ private void handleClusterDiscovered() {
}
LoadBalancerProvider lbProvider = null;
Object lbConfig = null;
if (root.result != null && root.result.lbPolicy() == LbPolicy.RING_HASH) {
if (root.result.lbPolicy() == LbPolicy.RING_HASH) {
lbProvider = lbRegistry.getProvider("ring_hash");
lbConfig = new RingHashConfig(root.result.minRingSize(), root.result.maxRingSize());
} else {
Expand Down
1 change: 1 addition & 0 deletions xds/src/main/java/io/grpc/xds/XdsNameResolver.java
Expand Up @@ -644,6 +644,7 @@ private static boolean matchHeader(HeaderMatcher headerMatcher, @Nullable String

@Nullable
private static String getHeaderValue(Metadata headers, String headerName) {
checkNotNull(headerName, "headerName");
if (headerName.endsWith(Metadata.BINARY_HEADER_SUFFIX)) {
return null;
}
Expand Down

0 comments on commit 3e1455f

Please sign in to comment.