|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
var utils = require('./imap.utilities');
|
|
|
|
|
|
|
|
|
|
var reCRLF = /\r\n/g,
|
|
|
|
|
reHdr = /^([^:]+):[ \t]?(.+)?$/;
|
|
|
|
|
var RE_CRLF = /\r\n/g,
|
|
|
|
|
RE_HDR = /^([^:]+):[ \t]?(.+)?$/;
|
|
|
|
|
|
|
|
|
|
exports.convStr = function(str, literals) {
|
|
|
|
|
if (str[0] === '"')
|
|
|
|
@ -20,7 +20,7 @@ exports.convStr = function(str, literals) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
exports.parseHeaders = function(str) {
|
|
|
|
|
var lines = str.split(reCRLF),
|
|
|
|
|
var lines = str.split(RE_CRLF),
|
|
|
|
|
headers = {}, m;
|
|
|
|
|
|
|
|
|
|
for (var i = 0, h, len = lines.length; i < len; ++i) {
|
|
|
|
@ -32,7 +32,7 @@ exports.parseHeaders = function(str) {
|
|
|
|
|
// it, so we follow the RFC and include the leading whitespace ...
|
|
|
|
|
headers[h][headers[h].length - 1] += lines[i];
|
|
|
|
|
} else {
|
|
|
|
|
m = reHdr.exec(lines[i]);
|
|
|
|
|
m = RE_HDR.exec(lines[i]);
|
|
|
|
|
h = m[1].toLowerCase();
|
|
|
|
|
if (m[2]) {
|
|
|
|
|
if (headers[h] === undefined)
|
|
|
|
|