Update armor.js

Small tweak
This commit is contained in:
Bart Butler 2017-08-19 10:49:36 -07:00 committed by GitHub
parent 93d823abb4
commit 1e8bd4315b

View File

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