xml/jid: JID parses correctly even if resource part is empty
Closed this issue · 1 comments
SamWhited commented
Parsing a JID with an empty resourcepart does not fail as expected:
_, err := jid.NewWithString("e@example.net/", false)
if err == nil { panic("oops") }
Empty resourceparts are illegal according to RFC7622 § 3.4. Resourcepart:
The resourcepart of a JID MUST NOT be zero octets in length and MUST
NOT be more than 1023 octets in length. This rule is to be enforced
after any normalization and mapping of code points as well as
encoding of the string as UTF-8.