class HostAllowlistUtils {

  static boolean isHostAuthorized(final List<String> allowlist, String hostHeader) {
    Optional<String> optionalHost = getAndValidateHostHeader(hostHeader);
    if (allowlist.contains("*")
        || (optionalHost.isPresent() && hostIsInAllowlist(allowlist, optionalHost.get()))) {
      return true;
    } else {
      return false;
    }
  }

}