-
I've looked for possible causes of this issue and for me it looks like the only way for
getDefHostName()
to return empty JID (BareJID
with empty domain part) is caused by settings-Dtigase-primary-address
to an empty value (adding-Dtigase-primary-address=
to Tigase options intigase.conf
.This is caused by the fact that
InetAddress::getByName(tigasePrimaryHost)
is NOT throwing an exception iftigasePrimaryHost
is set to an empty string, causing Tigase to accept this empty string as default hostname.Additionally,
BareJID
accepts domain ofBareJID
to be an empty string. In my opinion, this should not be allowed and we should:- throw
TigaseStringprepException
for methodsbareJIDInstance()
- return
null
for methodsbareJIDInstanceNS
(or throw NPE)
I think that we should also check if
tigase-secondary-address
does not have similar issues. - throw
-
Andrzej Wójcik wrote:
I've looked for possible causes of this issue and for me it looks like the only way for
getDefHostName()
to return empty JID (BareJID
with empty domain part) is caused by settings-Dtigase-primary-address
to an empty value (adding-Dtigase-primary-address=
to Tigase options intigase.conf
.This is caused by the fact that
InetAddress::getByName(tigasePrimaryHost)
is NOT throwing an exception iftigasePrimaryHost
is set to an empty string, causing Tigase to accept this empty string as default hostname.Thank you for pointing this out - I fixed both places in
stable
andmaster
.Additionally,
BareJID
accepts domain ofBareJID
to be an empty string. In my opinion, this should not be allowed and we should:- throw
TigaseStringprepException
for methodsbareJIDInstance()
- return
null
for methodsbareJIDInstanceNS
(or throw NPE)
You are correct according to 2.2. Domainpart:
it is the primary identifier and is the only **REQUIRED** element of a JID (a mere domainpart is a valid JID)
I added checks in
JIDInstance
methods and accompanying tests. - throw
Type |
Bug
|
Priority |
Normal
|
Assignee | |
RedmineID |
6911
|
Version |
tigase-server-7.1.4
|
Spent time |
0
|
It seems that tigase.server.BasicComponent#getDefHostName returns either empty or invalid value. Occurances with version 7.1.4 and 7.1.3-SNAPSHOT.