1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

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;
}