code: private boolean shouldOmitPortInHostHeader(HttpUrl url) {
      return (url.scheme().equals("http") && url.port() == 80)
        || (url.scheme().equals("https") && url.port() == 443);
    }
docs: Checks whether port should be omitted in Host header.
  
  <p>
  HTTP Spec (rfc2616) defines that port should be omitted in Host header
  when port and service matches (i.e HTTP -> 80, HTTPS -> 443)
  
  @param url Url object