Revert header collection behavior such that header values are always arrays of strings instead of only when duplicate headers are found

fork
Brian White 12 years ago
parent a77fa792b5
commit 733cb24767

@ -266,12 +266,10 @@ ImapConnection.prototype.connect = function(loginCb) {
for (var i=0,k,len=info.headers.length; i<len; i+=2) {
k = info.headers[i].toLowerCase();
if (headers[k] !== undefined) {
if (!Array.isArray(headers[k]))
headers[k] = [headers[k]];
if (headers[k] !== undefined)
headers[k].push(info.headers[i + 1]);
} else
headers[k] = info.headers[i + 1];
else
headers[k] = [info.headers[i + 1]];
}
self._state.requests[0]._msg.headers = headers;

Loading…
Cancel
Save