diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-01-15 21:02:16 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-01-15 21:02:16 -0800 |
commit | 10ce85ef9eed15276534938c7a18c04cb18ca7f2 (patch) | |
tree | 53ae265c2fda1def1d41c1bf96898a60c9081d58 /src/main/java/org/traccar/helper/ServletHelper.java | |
parent | 729021a19086d982c1b4ec5661d9140c42f030f8 (diff) | |
download | trackermap-server-10ce85ef9eed15276534938c7a18c04cb18ca7f2.tar.gz trackermap-server-10ce85ef9eed15276534938c7a18c04cb18ca7f2.tar.bz2 trackermap-server-10ce85ef9eed15276534938c7a18c04cb18ca7f2.zip |
Clean login failure logging
Diffstat (limited to 'src/main/java/org/traccar/helper/ServletHelper.java')
-rw-r--r-- | src/main/java/org/traccar/helper/ServletHelper.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/helper/ServletHelper.java b/src/main/java/org/traccar/helper/ServletHelper.java index f951d17c0..e3481e249 100644 --- a/src/main/java/org/traccar/helper/ServletHelper.java +++ b/src/main/java/org/traccar/helper/ServletHelper.java @@ -5,24 +5,23 @@ import javax.servlet.http.HttpServletRequest; public final class ServletHelper { - private ServletHelper() { } public static String retrieveRemoteAddress(HttpServletRequest request) { if (request != null) { - String ipAddress = request.getHeader("X-FORWARDED-FOR"); + String remoteAddress = request.getHeader("X-FORWARDED-FOR"); - if (ipAddress != null && !ipAddress.isEmpty()) { - return ipAddress.substring(0, ipAddress.indexOf(",")); //Removes the additional data + if (remoteAddress != null && !remoteAddress.isEmpty()) { + return remoteAddress.substring(0, remoteAddress.indexOf(",")); // removes the additional data } else { - ipAddress = request.getRemoteAddr(); - return ipAddress; + remoteAddress = request.getRemoteAddr(); + return remoteAddress; } - } else { return null; } } + } |