code: func getHost(r *http.Request) string {
  	if r.URL.IsAbs() {
  		host := r.Host
  		// Slice off any port information.
  		if i := strings.Index(host, ":"); i != -1 {
  			host = host[:i]
  		}
  		return host
  	}
  	return r.URL.Host
  }
docs: // Helpers --------------------------------------------------------------------
  // getHost tries its best to return the request host.