private String getHost()

in src/main/java/com/googlesource/gerrit/plugins/gitblit/GitBlitUrlsConfig.java [81:97]


  private String getHost(String hostname) throws UnknownHostException {
    if (hostname.equals("*")) {
      try {
        if (canonicalWebUrlString != null) {
          return new URI(canonicalWebUrlString).getHost();
        }
      } catch (URISyntaxException e) {
        log.error(
            "Cannot parse canonicalWebUrl and get external hostname,"
                + " fallback to auto-detected local hostname",
            e);
      }
      return InetAddress.getLocalHost().getCanonicalHostName();
    } else {
      return hostname;
    }
  }