jid: Test for too many @ before the resourcepart

This additionally should optimize the parsing a tiny bit by looking for
both @ and / at the same time and iterating on them, instead of one by
one.

Thanks nicoco for the report!
This commit is contained in:
Emmanuel Gil Peyrot 2025-02-04 18:11:42 +01:00 • committed by pep
commit f5f35eab20
3 changed files with 80 additions and 48 deletions

View file

@ -1,3 +1,9 @@
Version NEXT:
* Additions:
- Add missing check for JIDs with too many `@` before the resource, such as
`a@b@c` or `a@b@c/d` which should clearly be invalid. The new error it
produces is named `TooManyAts`.
Version 0.11.1, release 2024-07-23:
* Breaking:
- Move InnerJid into Jid and reformulate BareJid and FullJid in terms of