Fixup location conflict message for bare domain

This commit is contained in:
Johannes Zellner
2023-01-09 13:27:02 +01:00
parent 15e4ceeb76
commit 20cec7d5ef

View File

@@ -554,7 +554,7 @@ function getDuplicateErrorDetails(errorMessage, locations, portBindings) {
if (match[2] === 'locations.subdomain') {
for (let i = 0; i < locations.length; i++) {
const { subdomain, domain, type } = locations[i];
if (match[1] !== `${subdomain}-${domain}`) continue;
if (match[1] !== (subdomain ? `${subdomain}-${domain}` : domain)) continue;
return new BoxError(BoxError.ALREADY_EXISTS, `${type} location '${dns.fqdn(subdomain, domain)}' is in use`);
}