Browse Source

Adjust after review.

pull/1168/head
Olga Maciaszek-Sharma 2 years ago
parent
commit
e2a1b819c6
  1. 7
      spring-cloud-commons/src/main/java/org/springframework/cloud/client/DefaultServiceInstance.java

7
spring-cloud-commons/src/main/java/org/springframework/cloud/client/DefaultServiceInstance.java

@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
package org.springframework.cloud.client;
import java.net.URI;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -33,6 +33,8 @@ import java.util.Objects; @@ -33,6 +33,8 @@ import java.util.Objects;
*/
public class DefaultServiceInstance implements ServiceInstance {
private final List<String> secureSchemes = List.of("https", "wss");
private String instanceId;
private String serviceId;
@ -49,6 +51,7 @@ public class DefaultServiceInstance implements ServiceInstance { @@ -49,6 +51,7 @@ public class DefaultServiceInstance implements ServiceInstance {
private URI uri;
/**
* @param instanceId the id of the instance.
* @param serviceId the id of the service.
@ -181,7 +184,7 @@ public class DefaultServiceInstance implements ServiceInstance { @@ -181,7 +184,7 @@ public class DefaultServiceInstance implements ServiceInstance {
this.host = this.uri.getHost();
this.port = this.uri.getPort();
scheme = this.uri.getScheme();
if (Arrays.asList("https", "wss").contains(scheme)) {
if (secureSchemes.contains(scheme)) {
this.secure = true;
}
}

Loading…
Cancel
Save