public static String getClientIp(ServerHttpRequest request) {
        for (String header : IP_HEADER_NAMES) {
            String ipList = request.getHeaders().getFirst(header);
            if (StringUtils.hasText(ipList) && !UNKNOWN.equalsIgnoreCase(ipList)) {
                String[] ips = ipList.trim().split("[,;]");
                for (String ip : ips) {
                    if (StringUtils.hasText(ip) && !UNKNOWN.equalsIgnoreCase(ip)) {
                        return ip;
                    }
                }
            }
        }
        var remoteAddress = request.getRemoteAddress();
        return remoteAddress == null || remoteAddress.isUnresolved()
            ? UNKNOWN : remoteAddress.getAddress().getHostAddress();
    }
@Test
    void testGetIPAddressWithMultipleHeaders() {
        var headers = new HttpHeaders();
        headers.add("X-Forwarded-For", "127.0.0.1, 127.0.1.1");
        headers.add("Proxy-Client-IP", "127.0.0.2");
        headers.add("CF-Connecting-IP", "127.0.0.2");
        headers.add("WL-Proxy-Client-IP", "127.0.0.3");
        headers.add("HTTP_CLIENT_IP", "127.0.0.4");
        headers.add("HTTP_X_FORWARDED_FOR", "127.0.0.5");
        var request = MockServerHttpRequest.get("/")
            .headers(headers)
            .build();
        var expected = "127.0.0.1";
        var actual = IpAddressUtils.getClientIp(request);
        assertEquals(expected, actual);
    }