HttpServerRequestUtil { public static boolean isRemoteAddressLoopbackAddress(HttpServerRequest request){ String host = request.remoteAddress().host(); if(StringUtils.isEmpty(host)){ return false; } return host.startsWith("127") || host.equalsIgnoreCase("localhost"); } private  HttpServerRequestUtil(); static boolean isRemoteAddressLoopbackAddress(HttpServerRequest request); static void increaseRequestHops(HttpServerRequest request); static boolean isRequestHopsLimitExceeded(HttpServerRequest request, Integer hopsLimit); static void prepareResponse(HttpServerRequest request, HttpClientResponse response);  }
@Test public void testIsRemoteAddressLoopbackAddress(TestContext context){ context.assertTrue(HttpServerRequestUtil.isRemoteAddressLoopbackAddress(new RemoteAddressRequest("127.0.0.1"))); context.assertTrue(HttpServerRequestUtil.isRemoteAddressLoopbackAddress(new RemoteAddressRequest("localhost"))); context.assertFalse(HttpServerRequestUtil.isRemoteAddressLoopbackAddress(new RemoteAddressRequest(""))); }