private void initializeAllowedHostPorts() {
      boolean proxyCallRestricted = false;
      Map<String, HashSet<String>> allowed = new HashMap<>();
      if (StringUtils.isNotBlank(allowedHostPortsValue)) {
        String allowedStr = allowedHostPortsValue.toLowerCase();
        if (!allowedStr.equals(Configuration.PROXY_ALLOWED_HOST_PORTS.getDefaultValue())) {
          proxyCallRestricted = true;
          String[] hostPorts = allowedStr.trim().split(",");
          for (String hostPortStr : hostPorts) {
            String[] hostAndPort = hostPortStr.trim().split(":");
            if (hostAndPort.length == 1) {
              if (!allowed.containsKey(hostAndPort[0])) {
                allowed.put(hostAndPort[0], new HashSet<>());
              }
              allowed.get(hostAndPort[0]).add("*");
              LOG.debug("Allow proxy to host {} and all ports.", hostAndPort[0]);
            } else {
              if (!allowed.containsKey(hostAndPort[0])) {
                allowed.put(hostAndPort[0], new HashSet<>());
              }
              allowed.get(hostAndPort[0]).add(hostAndPort[1]);
              LOG.debug("Allow proxy to host {} and port {}", hostAndPort[0], hostAndPort[1]);
            }
          }
        }
      }
      allowedHostPorts = allowed;
      isProxyCallRestricted = proxyCallRestricted;
    }
Initialize the allowed list of hosts and ports
ambari-server/src/main/java/org/apache/ambari/server/view/ViewURLStreamProvider.java