Fix for issue 573: don't throw with unknown Armor Headers, but just

with invalid ones
This commit is contained in:
Patrick Brunschwig 2017-08-19 18:32:02 +02:00
parent dc2d38d355
commit 93d823abb4

View File

@ -224,7 +224,7 @@ function splitHeaders(text) {
*/
function verifyHeaders(headers) {
for (var i = 0; i < headers.length; i++) {
if (!/^(Version|Comment|MessageID|Hash|Charset): .+$/.test(headers[i])) {
if (!/^[^: ]+: .+$/.test(headers[i])) {
throw new Error('Improperly formatted armor header: ' + headers[i]);
}
}