-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct nick validation #1114
Correct nick validation #1114
Conversation
This allows for easier unit testing. Tests were not added for the "nick must start with a letter" condition, because this will be changed in the next commit. Signed-off-by: Dexter Chua <dec41@srcf.net>
According to RFC 2812 § 2.3.1 is allowed to start with either a letter or a special character. Previously, this followed the older RFC 1459 that only allowed letters (but the rest of the logic follows RFC 2812). Fixes matrix-org#467 Signed-off-by: Dexter Chua <dec41@srcf.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great stuff, thank you for taking the time with the tests too. Only a few language suggestions from me.
describe("BridgedClient", function() { | ||
describe("getValidNick", function() { | ||
it("valid nick unchanged", function() { | ||
expect(BridgedClient.getValidNick("foobar", true, STATE_DISC)).toBe("foobar"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be good to have more valid examples here containing numbers and special characters
Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Will Hunt <will@half-shot.uk>
Co-authored-by: Will Hunt <will@half-shot.uk>
According to RFC 2812 § 2.3.1 is allowed to start with either a letter or a
special character. Previously, this followed the older RFC 1459 that only
allowed letters (but the rest of the logic follows RFC 2812).
Fixes #467. Supersedes #552.