From a06a671415434f16693121bff2bee8e284e9b593 Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 3 Aug 2017 16:23:34 -0400 Subject: [PATCH] fix ip bans lol --- contrib/backends/srndv2/src/srnd/util.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/util.go b/contrib/backends/srndv2/src/srnd/util.go index f9cc6f6..2e91a4b 100644 --- a/contrib/backends/srndv2/src/srnd/util.go +++ b/contrib/backends/srndv2/src/srnd/util.go @@ -271,7 +271,12 @@ func decAddr(encaddr, key string) string { res_bytes[idx] = encaddr_bytes[idx] ^ b } res := string(res_bytes) - return strings.Trim(res, " ") + res = strings.Trim(res, " ") + if strings.Index(res, "/") == -1 { + // TODO: ipv6 + res += "/32" + } + return res } var exp_valid_newsgroup = regexp.MustCompilePOSIX(`^[a-zA-Z0-9.]{1,128}$`)