Allow JIDs such as "example.net/@"

This commit is contained in:
Sam Whited 2014-12-02 10:17:50 -05:00
parent 4f9dd82457
commit 29a7828c5f
1 changed files with 2 additions and 3 deletions

View File

@ -70,10 +70,9 @@ public final class Jid {
}
// Go ahead and check if the localpart or resourcepart is empty.
if (jid.startsWith("@") || jid.endsWith("@") ||
jid.startsWith("/") || jid.endsWith("/")) {
if (jid.startsWith("@") || (jid.endsWith("@") && slashCount == 0) || jid.startsWith("/") || (jid.endsWith("/") && slashCount < 2)) {
throw new InvalidJidException(InvalidJidException.INVALID_CHARACTER);
}
}
String finaljid;