Shelaslifter commented on code in PR #4825:
URL: https://github.com/apache/fineract/pull/4825#discussion_r2261874622


##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/core/api/JsonCommand.java:
##########
@@ -597,4 +599,15 @@ public void checkForUnsupportedParameters(final Type 
typeOfMap, final String jso
         this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, 
requestDataParameters);
     }
 
+    public String getClientIp() {
+        ServletRequestAttributes attrs = (ServletRequestAttributes) 
RequestContextHolder.getRequestAttributes();
+        String clientIp = "";
+        if (attrs != null) {
+            Object ipAttr = attrs.getRequest().getAttribute("IP");
+            if (ipAttr != null) {
+                clientIp = ipAttr.toString();
+            }
+        }
+        return clientIp;

Review Comment:
   @adamsaghy hi, the IpAddressUtils.java class was created, and the 
JsonCommand was removed from the class.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to