Set the domain and subdomain in details
This commit is contained in:
@@ -689,10 +689,10 @@ function validateLocations(locations, callback) {
|
||||
if (error) return callback(error);
|
||||
|
||||
for (let location of locations) {
|
||||
if (!(location.domain in domainObjectMap)) return callback(new AppsError(AppsError.BAD_FIELD, 'No such domain', { field: 'location' }));
|
||||
if (!(location.domain in domainObjectMap)) return callback(new AppsError(AppsError.BAD_FIELD, 'No such domain', { field: 'location', domain: location.domain, subdomain: location.subdomain }));
|
||||
|
||||
error = domains.validateHostname(location.subdomain, domainObjectMap[location.domain]);
|
||||
if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Bad location: ' + error.message, { field: 'location', location }));
|
||||
if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Bad location: ' + error.message, { field: 'location', domain: location.domain, subdomain: location.subdomain }));
|
||||
}
|
||||
|
||||
callback(null, domainObjectMap);
|
||||
|
||||
Reference in New Issue
Block a user