Fix key / value handling (#56)

This commit is contained in:
Erayd
2019-04-01 02:53:25 +13:00
committed by Maxim Baz
parent ed9c7a7697
commit 25e9435487

View File

@@ -758,9 +758,13 @@ async function parseFields(settings, login) {
};
var lines = login.raw.split(/[\r\n]+/).filter(line => line.trim().length > 0);
lines.forEach(function(line) {
// split key / value
var parts = line
.split(/:(.*)?/, 2)
// split key / value & ignore non-k/v lines
var parts = line.match(/^(.+?):(.+)$/);
if (parts === null) {
return;
}
parts = parts
.slice(1)
.map(value => value.trim())
.filter(value => value.length);
if (parts.length != 2) {