Skip to content

Commit

Permalink
Fix XWIKI-22547 with ShortURL exception
Browse files Browse the repository at this point in the history
  • Loading branch information
promasu committed Oct 5, 2024
1 parent 379064c commit 5ced79e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ public String url(String pathOrRoleHint)
XWikiContext xcontext = this.xcontextProvider.get();

StringBuilder path = new StringBuilder("/");
path.append(xcontext.getWiki().getWebAppPath(xcontext));
if (!xcontext.getWiki().getWebAppPath(xcontext).equals('/')) {
path.append(xcontext.getWiki().getWebAppPath(xcontext));
}
path.append("websocket").append(path(pathOrRoleHint));

URL serverURL = xcontext.getURLFactory().getServerURL(xcontext);
String scheme = "https".equals(serverURL.getProtocol()) ? "wss" : "ws";
// We have to add the path afterwards because the URI constructor double encodes it.
Expand Down

0 comments on commit 5ced79e

Please sign in to comment.