Browse Source

use only default https ports for https check

spring boot uses all high ports and there are some trouble if ports end with 443 (e.g. 24443, ...)
pull/6/head
Rico Pahlisch 8 years ago committed by GitHub
parent
commit
ccf8f86c8d
  1. 7
      spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/DefaultServerIntrospector.java

7
spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/DefaultServerIntrospector.java

@ -16,7 +16,9 @@
package org.springframework.cloud.netflix.ribbon; package org.springframework.cloud.netflix.ribbon;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.netflix.loadbalancer.Server; import com.netflix.loadbalancer.Server;
@ -25,10 +27,11 @@ import com.netflix.loadbalancer.Server;
* @author Spencer Gibb * @author Spencer Gibb
*/ */
public class DefaultServerIntrospector implements ServerIntrospector { public class DefaultServerIntrospector implements ServerIntrospector {
private static final List<Integer> SECURE_PORTS = Arrays.asList(443, 8443);
@Override @Override
public boolean isSecure(Server server) { public boolean isSecure(Server server) {
// Can we do better? return SECURE_PORTS.contains(server.getPort());
return (""+server.getPort()).endsWith("443");
} }
@Override @Override

Loading…
Cancel
Save