Merge pull request #46 from slingamn/inputtoolong.1

allow ERR_INPUTTOOLONG if a PRIVMSG cannot be relayed
This commit is contained in:
Shivaram Lingamneni 2021-03-03 17:11:36 -05:00 committed by GitHub
commit 5b82b9b3d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,7 @@ class MessageTagsTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
self.assertEqual(alice_msg.tags["msgid"], bob_msg.tags["msgid"]) self.assertEqual(alice_msg.tags["msgid"], bob_msg.tags["msgid"])
@cases.mark_capabilities("message-tags") @cases.mark_capabilities("message-tags")
@cases.mark_specifications("ircdocs")
def testLengthLimits(self): def testLengthLimits(self):
self.connectClient( self.connectClient(
"alice", "alice",
@ -154,6 +155,13 @@ class MessageTagsTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
self.assertEqual(len(max_privmsg), 4096 + (512 - 2)) self.assertEqual(len(max_privmsg), 4096 + (512 - 2))
self.sendLine("alice", max_privmsg) self.sendLine("alice", max_privmsg)
echo = self.getMessage("alice") echo = self.getMessage("alice")
# the server may still reject this message on the grounds that the final
# parameter is too long to be relayed without truncation, once alice's
# NUH is included. however, if the message was accepted, the tags MUST
# be relayed intact, because they are unquestionably valid. See the
# original context of ERR_INPUTTOOLONG:
# https://defs.ircdocs.horse/defs/numerics.html#err-inputtoolong-417
if echo.command != ERR_INPUTTOOLONG:
relay = self.getMessage("bob") relay = self.getMessage("bob")
self.assertMessageMatch( self.assertMessageMatch(
echo, echo,