code: public String getHostName() {
          String host = requestHeaders.getFirst(Headers.HOST);
          if (host == null) {
              host = getDestinationAddress().getHostString();
          } else {
              if (host.startsWith("[")) {
                  host = host.substring(1, host.indexOf(']'));
              } else if (host.indexOf(':') != -1) {
                  host = host.substring(0, host.indexOf(':'));
              }
          }
          return host;
      }
docs: Return the host that this request was sent to, in general this will be the
  value of the Host header, minus the port specifier.
  <p>
  If this resolves to an IPv6 address it will not be enclosed by square brackets.
  Care must be taken when constructing URLs based on this method to ensure IPv6 URLs
  are handled correctly.
  
  @return The host part of the destination address