don't allow leading spaces in user id

This commit is contained in:
Sanjana Rajan 2016-12-14 12:38:01 -08:00
parent a6b81b127b
commit 109f8a5d20
2 changed files with 5 additions and 2 deletions

View File

@ -391,7 +391,10 @@ function formatUserIds(options) {
if (!util.isString(id.name) || (id.email && !util.isEmailAddress(id.email))) {
throw new Error('Invalid user id format');
}
return id.name + ' <' + id.email + '>';
if (id.name) {
id.name += ' ';
}
return id.name + '<' + id.email + '>';
});
return options;
}

View File

@ -51,7 +51,7 @@ export default {
if (!this.isString(data)) {
return false;
}
return / </.test(data) && />$/.test(data);
return /</.test(data) && />$/.test(data);
},
/**