URI requestUri = RequestUtils.getURI(this);
String authority = requestUri.getRawAuthority();
if (authority != null) {
buf.append(authority);
} else {
ConnectionInformation conn = getConnectionInformation();
// if the URI has no authority info, construct from the local address
buf.append(conn.getLocalName());
int port = conn.getLocalPort();
if (port != 80) {
buf.append(':').append(port);
}
}