Modify register/available to be GET with query param

- GET is now the method for register/available
- a query parameter "username" is now used

Also, empty usernames are now handled with an error message on registration or via register/available: `User ID cannot be empty`
This commit is contained in:
Luke Barnard 2017-05-10 17:17:12 +01:00
parent a3648f84b2
commit 369195caa5
2 changed files with 11 additions and 5 deletions

View file

@ -54,6 +54,13 @@ class RegistrationHandler(BaseHandler):
Codes.INVALID_USERNAME
)
if len(localpart) == 0:
raise SynapseError(
400,
"User ID cannot be empty",
Codes.INVALID_USERNAME
)
if localpart[0] == '_':
raise SynapseError(
400,