Skip to content

Commit

Permalink
Prevent 433 response for Nonutf8{User/Real}name (#244)
Browse files Browse the repository at this point in the history
Sending `NICK foo` after connectClient() causes an ERR_NICKNAMEINUSE
response instead of the expected RPL_WELCOME.
  • Loading branch information
mitchr authored Dec 31, 2023
1 parent 6425e70 commit 18d04e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions irctest/server_tests/utf8.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ def testNonutf8Realname(self):
raise runner.IsupportTokenNotSupported("UTF8ONLY")

self.addClient()
self.sendLine(2, "NICK foo")
self.sendLine(2, "NICK bar")
self.clients[2].conn.sendall(b"USER username * * :i\xe8rc\xe9\r\n")

d = self.clients[2].conn.recv(1024)
if b" FAIL " in d or b" 468 " in d: # ERR_INVALIDUSERNAME
if b"FAIL " in d or b"468 " in d: # ERR_INVALIDUSERNAME
return # nothing more to test
self.assertIn(b" 001 ", d)
self.assertIn(b"001 ", d)

self.sendLine(2, "WHOIS foo")
self.sendLine(2, "WHOIS bar")
self.getMessages(2)

def testNonutf8Username(self):
Expand All @@ -71,7 +71,7 @@ def testNonutf8Username(self):
raise runner.IsupportTokenNotSupported("UTF8ONLY")

self.addClient()
self.sendLine(2, "NICK foo")
self.sendLine(2, "NICK bar")
self.sendLine(2, "USER 😊😊😊😊😊😊😊😊😊😊 * * :realname")
m = self.getRegistrationMessage(2)
if m.command in ("FAIL", "468"): # ERR_INVALIDUSERNAME
Expand All @@ -80,7 +80,7 @@ def testNonutf8Username(self):
m,
command="001",
)
self.sendLine(2, "WHOIS foo")
self.sendLine(2, "WHOIS bar")
self.getMessages(2)


Expand Down

0 comments on commit 18d04e8

Please sign in to comment.