From 6ce1dc04697bda67221e81edaf8b84727b16bc78 Mon Sep 17 00:00:00 2001 From: handlerug Date: Thu, 27 May 2021 11:41:36 +0700 Subject: [PATCH] Disallow registration with anon username --- util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/util.go b/util/util.go index 0cd0ca0..4117b63 100644 --- a/util/util.go +++ b/util/util.go @@ -98,7 +98,7 @@ func IsCanonicalName(name string) bool { } func IsPossibleUsername(username string) bool { - return UsernamePattern.MatchString(strings.TrimSpace(username)) + return username != "anon" && UsernamePattern.MatchString(strings.TrimSpace(username)) } // HyphaNameFromRq extracts hypha name from http request. You have to also pass the action which is embedded in the url or several actions. For url /hypha/hypha, the action would be "hypha".