private boolean isSameAuthority(final HttpHost h1, final HttpHost h2) {
        if (h1 == null || h2 == null) {
            return false;
        }
        final String host1 = h1.getHostName();
        final String host2 = h2.getHostName();
        if (!host1.equalsIgnoreCase(host2)) {
            return false;
        }
        final int port1 = schemePortResolver.resolve(h1);
        final int port2 = schemePortResolver.resolve(h2);
        return port1 == port2;
    }
Creates a new {@code DefaultRedirectStrategy} with the default
{@link DefaultSchemePortResolver#INSTANCE}.

@since 5.6
httpclient5/src/main/java/org/apache/hc/client5/http/impl/DefaultRedirectStrategy.java