public static String authorityHeader(String host, int port, int defaultPort) {
        if (port == defaultPort) {
            return host;
        } else {
            final StringBuilder buf = new StringBuilder(host.length() + 6);
            buf.append(host);
            buf.append(':');
            buf.append(port);
            return buf.toString();
        }
    }
Returns a authority header value of specified host and port.
core/src/main/java/com/linecorp/armeria/internal/common/ArmeriaHttpUtil.java