From aea970e24f95c02ccc62d388c0577fdcc1a09f28 Mon Sep 17 00:00:00 2001 From: "Andrew Morgan (https://amorgan.xyz)" Date: Thu, 30 Nov 2017 02:25:17 -0800 Subject: [PATCH] Squash username to all lowercase letters upon registration Signed-off-by: Andrew Morgan (https://amorgan.xyz) --- .../matrix-org/dendrite/clientapi/routing/register.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go index ef8fbaf54..ac88e1ce1 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go @@ -183,6 +183,9 @@ func Register( } } + // Squash username to all lowercase letters + r.Username = strings.ToLower(r.Username) + if resErr = validateUserName(r.Username); resErr != nil { return *resErr }