1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-25 03:57:58 +01:00

[bosh] Allow for file to be 'null'

This commit is contained in:
Florian Schmaus 2022-08-03 16:58:31 +02:00
parent 6eb1004d38
commit e768bc8bfb

View file

@ -47,10 +47,14 @@ public final class BOSHConfiguration extends ConnectionConfiguration {
} }
} }
https = builder.https; https = builder.https;
if (builder.file.charAt(0) != '/') { if (builder.file != null) {
file = '/' + builder.file; if (builder.file.charAt(0) != '/') {
file = '/' + builder.file;
} else {
file = builder.file;
}
} else { } else {
file = builder.file; file = null;
} }
httpHeaders = builder.httpHeaders; httpHeaders = builder.httpHeaders;
} }
@ -77,7 +81,7 @@ public final class BOSHConfiguration extends ConnectionConfiguration {
} }
public URI getURI() throws URISyntaxException { public URI getURI() throws URISyntaxException {
String uri = (https ? "https://" : "http://") + getHostString() + ":" + this.port + file; String uri = (https ? "https://" : "http://") + getHostString() + ":" + this.port + (file != null ? file : "");
return new URI(uri); return new URI(uri);
} }