diff --git a/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/locators.go b/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/locators.go index bed6d7baa3..3ddc1dedad 100644 --- a/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/locators.go +++ b/core/server/api_container/server/startosis_engine/startosis_packages/git_package_content_provider/locators.go @@ -20,6 +20,8 @@ func isLocalLocator(locator string) bool { } func shouldBlockAbsoluteLocatorBecauseIsInTheSameSourceModuleLocatorPackage(relativeOrAbsoluteLocator string, sourceModuleLocator string, rootPackageId string) bool { + // Make sure the root package id ends with a trailing slash. + rootPackageId = strings.TrimPrefix(rootPackageId, "/") + "/" isSourceModuleInRootPackage := strings.HasPrefix(sourceModuleLocator, rootPackageId) isAbsoluteLocatorInRootPackage := strings.HasPrefix(relativeOrAbsoluteLocator, rootPackageId) return isSourceModuleInRootPackage && isAbsoluteLocatorInRootPackage