From fbc9438e910c917a9e447e6727a09e02e3b318f4 Mon Sep 17 00:00:00 2001 From: Colin McDonald Date: Wed, 13 Jul 2016 23:56:17 -0400 Subject: [PATCH] Fix ip address validation in POST /server --- .../java/net/frozenorb/apiv3/route/servers/POSTServers.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/frozenorb/apiv3/route/servers/POSTServers.java b/src/main/java/net/frozenorb/apiv3/route/servers/POSTServers.java index 6e16af8..fe65b56 100644 --- a/src/main/java/net/frozenorb/apiv3/route/servers/POSTServers.java +++ b/src/main/java/net/frozenorb/apiv3/route/servers/POSTServers.java @@ -29,7 +29,9 @@ public final class POSTServers implements Handler { return; } - if (!IpUtils.isValidIp(ip)) { + String ipHost = ip.split(":")[0]; + + if (!IpUtils.isValidIp(ipHost)) { ErrorUtils.respondInvalidInput(ctx, "Ip address \"" + ip + "\" is not valid."); return; }