[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
1 changed files with 8 additions and 4 deletions

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