Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit 22ce531

Browse files
committed
allow numeric usernames less than MAX_INT64
1 parent be0c27e commit 22ce531

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

clientapi/routing/register.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,6 @@ func Register(
513513
return handleGuestRegistration(req, r, cfg, userAPI)
514514
}
515515

516-
// Don't allow numeric usernames less than MAX_INT64.
517-
if _, err = strconv.ParseInt(r.Username, 10, 64); err == nil {
518-
return util.JSONResponse{
519-
Code: http.StatusBadRequest,
520-
JSON: spec.InvalidUsername("Numeric user IDs are reserved"),
521-
}
522-
}
523516
// Auto generate a numeric username if r.Username is empty
524517
if r.Username == "" {
525518
nreq := &userapi.QueryNumericLocalpartRequest{

sytest-whitelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ PUT /rooms/:room_id/redact/:event_id/:txn_id is idempotent
709709
Unnamed room comes with a name summary
710710
Named room comes with just joined member count summary
711711
Room summary only has 5 heroes
712+
registration is idempotent, without username specified
712713
registration is idempotent, with username specified
713714
Setting state twice is idempotent
714715
Joining room twice is idempotent

0 commit comments

Comments
 (0)