public boolean allowProxy(String host, String port) {
      LOG.debug("Checking host {} port {} against allowed list.", host, port);
      if (StringUtils.isNotBlank(host)) {
        String hostToCompare = host.trim().toLowerCase();
        if (allowedHostPorts == null) {
          initializeAllowedHostPorts();
        }

        if (isProxyCallRestricted) {
          if (allowedHostPorts.containsKey(hostToCompare)) {
            if (allowedHostPorts.get(hostToCompare).contains("*")) {
              return true;
            }
            String portToCompare = "";
            if (StringUtils.isNotBlank(port)) {
              portToCompare = port.trim();
            }
            if (allowedHostPorts.get(hostToCompare).contains(portToCompare)) {
              return true;  // requested host port allowed
            }
            return false;
          }
          return false; // restricted, at least hostname need to match
        } // no restriction
      }
      return true;
    }
Checks supplied host and port against the restriction list

@param host
@param port

@return if the host and port combination is allowed
ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java