From e768bc8bfb7fe34163435ccf78f4704fa3f2d0be Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 3 Aug 2022 16:58:31 +0200 Subject: [PATCH] [bosh] Allow for file to be 'null' --- .../jivesoftware/smack/bosh/BOSHConfiguration.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/BOSHConfiguration.java b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/BOSHConfiguration.java index a4c2db65e..e47d7477c 100644 --- a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/BOSHConfiguration.java +++ b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/BOSHConfiguration.java @@ -47,10 +47,14 @@ public final class BOSHConfiguration extends ConnectionConfiguration { } } https = builder.https; - if (builder.file.charAt(0) != '/') { - file = '/' + builder.file; + if (builder.file != null) { + if (builder.file.charAt(0) != '/') { + file = '/' + builder.file; + } else { + file = builder.file; + } } else { - file = builder.file; + file = null; } httpHeaders = builder.httpHeaders; } @@ -77,7 +81,7 @@ public final class BOSHConfiguration extends ConnectionConfiguration { } 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); }