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