diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java index 2e3b8ab6..58f918c3 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_activitylog.java @@ -16,7 +16,7 @@ public class Module_activitylog extends HTTPDModule @Override public NanoHTTPD.Response getResponse() { - final String remoteAddress = socket.getRemoteSocketAddress().toString(); + final String remoteAddress = socket.getInetAddress().getHostAddress(); if (!isAuthorized(remoteAddress)) { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java index a94e666a..b8234148 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_indefbans.java @@ -18,7 +18,7 @@ public class Module_indefbans extends HTTPDModule { File indefbanFile = new File(plugin.getDataFolder(), IndefiniteBanList.CONFIG_FILENAME); - final String remoteAddress = socket.getRemoteSocketAddress().toString(); + final String remoteAddress = socket.getInetAddress().getHostAddress(); if (!isAuthorized(remoteAddress)) { return new NanoHTTPD.Response(NanoHTTPD.Response.Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java index e2d7f55e..b6523684 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_logfile.java @@ -65,7 +65,7 @@ public class Module_logfile extends HTTPDModule } final StringBuilder out = new StringBuilder(); - final String remoteAddress = socket.getRemoteSocketAddress().toString(); + final String remoteAddress = socket.getInetAddress().getHostAddress(); final String[] args = StringUtils.split(uri, "/"); final ModuleMode mode = ModuleMode.getMode(getArg(args)); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java index 9bfe124c..e9196b6c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_punishments.java @@ -20,7 +20,7 @@ public class Module_punishments extends HTTPDModule File punishmentFile = new File(plugin.getDataFolder(), PunishmentList.CONFIG_FILENAME); if (punishmentFile.exists()) { - final String remoteAddress = socket.getRemoteSocketAddress().toString(); + final String remoteAddress = socket.getInetAddress().getHostAddress(); if (!isAuthorized(remoteAddress)) { return new NanoHTTPD.Response(NanoHTTPD.Response.Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java index 2459de14..23eb7e5a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_schematic.java @@ -131,7 +131,7 @@ public class Module_schematic extends HTTPDModule } case UPLOAD: { - final String remoteAddress = socket.getRemoteSocketAddress().toString(); + final String remoteAddress = socket.getInetAddress().getHostAddress(); if (!isAuthorized(remoteAddress)) { out.append(HTMLGenerationTools.paragraph("Schematic upload access denied: Your IP, " + remoteAddress + ", is not registered to an admin on this server."));