Skip to content

Commit 423cb0e

Browse files
author
JW Wesson
committed
fix for #52 double-slash in Matching UI URLs
1 parent 3d7ad3a commit 423cb0e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/main/java/com/sovren/ApiEndpoints.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,22 @@ class ApiEndpoints {
1616
_dataCenter = dataCenter;
1717
}
1818

19-
private String versionSuffix() {
20-
String versionSuffix = "";
21-
if (_dataCenter.Version != null && !_dataCenter.Version.trim().isEmpty()){
22-
versionSuffix = "/" + _dataCenter.Version;
23-
}
24-
return versionSuffix;
25-
}
26-
2719
private String prefix() {
28-
return _dataCenter.Root + versionSuffix();
20+
return prefix(false);
2921
}
3022

3123
private String prefix(boolean isMatchUI) {
3224
if (isMatchUI && !_dataCenter.IsSovrenSaaS) {
3325
//throw new IllegalAccessException("Cannot call Matching UI on a self-hosted installation.");
3426
//do not throw this for now, it will just be a 404
3527
}
36-
return _dataCenter.Root + "/" + (isMatchUI ? _matchUIPrefix : "") + versionSuffix();
28+
29+
String versionSuffix = "";
30+
if (_dataCenter.Version != null && !_dataCenter.Version.trim().isEmpty()){
31+
versionSuffix = "/" + _dataCenter.Version;
32+
}
33+
34+
return _dataCenter.Root + (isMatchUI ? _matchUIPrefix : "") + versionSuffix;
3735
}
3836

3937
private String sanitize(String indexOrDocId) throws IllegalArgumentException {

0 commit comments

Comments
 (0)