mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-15 12:37:18 +00:00
Fix Rest Util if empty of null om url (#21133)
(cherry picked from commit 2a205d5c35f2300a17abd05ea15ebb3ff34fbb1b)
This commit is contained in:
parent
7193e973d9
commit
1c3ed76f3f
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
package org.openmetadata.service.util;
|
package org.openmetadata.service.util;
|
||||||
|
|
||||||
|
import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty;
|
||||||
import static org.openmetadata.schema.type.EventType.ENTITY_CREATED;
|
import static org.openmetadata.schema.type.EventType.ENTITY_CREATED;
|
||||||
import static org.openmetadata.schema.type.EventType.ENTITY_NO_CHANGE;
|
import static org.openmetadata.schema.type.EventType.ENTITY_NO_CHANGE;
|
||||||
import static org.openmetadata.schema.type.EventType.ENTITY_RESTORED;
|
import static org.openmetadata.schema.type.EventType.ENTITY_RESTORED;
|
||||||
@ -70,12 +71,14 @@ public final class RestUtil {
|
|||||||
public static URI getHref(UriInfo uriInfo, String collectionPath) {
|
public static URI getHref(UriInfo uriInfo, String collectionPath) {
|
||||||
collectionPath = removeSlashes(collectionPath);
|
collectionPath = removeSlashes(collectionPath);
|
||||||
OpenMetadataBaseUrlConfiguration urlConfiguration =
|
OpenMetadataBaseUrlConfiguration urlConfiguration =
|
||||||
SettingsCache.getSettingOrDefault(
|
SettingsCache.getSetting(
|
||||||
SettingsType.OPEN_METADATA_BASE_URL_CONFIGURATION,
|
SettingsType.OPEN_METADATA_BASE_URL_CONFIGURATION,
|
||||||
new OpenMetadataBaseUrlConfiguration()
|
|
||||||
.withOpenMetadataUrl(uriInfo.getBaseUri().toString()),
|
|
||||||
OpenMetadataBaseUrlConfiguration.class);
|
OpenMetadataBaseUrlConfiguration.class);
|
||||||
return URI.create(urlConfiguration.getOpenMetadataUrl() + "/" + collectionPath);
|
String url =
|
||||||
|
nullOrEmpty(urlConfiguration.getOpenMetadataUrl())
|
||||||
|
? uriInfo.getBaseUri().toString()
|
||||||
|
: urlConfiguration.getOpenMetadataUrl();
|
||||||
|
return URI.create(url + "/" + collectionPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static URI getHref(URI parent, String child) {
|
public static URI getHref(URI parent, String child) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user