improve service url builder to support organization routed urls
@@ -124,9 +124,13 @@ public class DefaultServiceURLBuilder implements ServiceURLBuilder {
if (IdentityTenantUtil.isTenantQualifiedUrlsEnabled() && !resolvedUrlContext.startsWith("t/") &&
!resolvedUrlContext.startsWith("o/")) {
if (mandateTenantedPath || isNotSuperTenant(tenantDomain)) {
+ if (PrivilegedCarbonContext.getThreadLocalCarbonContext().getOrganizationId() != null) {
+ resolvedUrlStringBuilder.append("/o/").append(tenantDomain);
+ } else {
resolvedUrlStringBuilder.append("/t/").append(tenantDomain);
}
}
+ }
if (StringUtils.isNotBlank(resolvedUrlContext)) {
if (resolvedUrlContext.trim().charAt(0) != '/') {
