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, ...)
This commit is contained in:
Rico Pahlisch
2017-05-31 12:04:09 +02:00
committed by GitHub
parent 7425f974cb
commit ccf8f86c8d

View File

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