Merge branch '4.4'

This commit is contained in:
Florian Schmaus 2022-05-18 21:46:19 +02:00
commit e51bfb1dbe
2 changed files with 12 additions and 1 deletions

View File

@ -77,7 +77,8 @@ public final class BOSHConfiguration extends ConnectionConfiguration {
}
public URI getURI() throws URISyntaxException {
return new URI((https ? "https://" : "http://") + this.host + ":" + this.port + file);
String uri = https ? "https://" : "http://" + getHostString() + ":" + this.port + file;
return new URI(uri);
}
public Map<String, String> getHttpHeaders() {

View File

@ -302,6 +302,16 @@ public abstract class ConnectionConfiguration {
return new SmackTlsContext(context, daneVerifier);
}
public String getHostString() {
if (hostAddress != null) {
return hostAddress.toString();
}
if (host != null) {
return host.toString();
}
return xmppServiceDomain.toString();
}
public DnsName getHost() {
return host;
}