#276 Made parseHeader parse only header and ignore message's body + test.

fork
Alex Indigo 11 years ago
parent 6b52620fd9
commit 16dfe6a894

@ -719,7 +719,7 @@ function parseHeader(str, noDecode) {
for (var i = 0; i < len; ++i) {
if (lines[i].length === 0)
continue;
break; // empty line separates message's header and body
if (lines[i][0] === '\t' || lines[i][0] === ' ') {
// folded header content
val = lines[i];

@ -38,6 +38,15 @@ var CRLF = '\r\n';
expected: { subject: [ '测试题目与中国信 long subjects are not OK 12 345678901234567890123456789012345678901234567890123456789012345678901234567890' ] },
what: 'Folded header value (one adjacent, one non-adjacent MIME encoded-words)'
},
// header with body
{ source: ['Subject: test subject', CRLF,
'X-Another-Header: test', CRLF,
CRLF,
'This is body: Not a header', CRLF],
expected: { subject: [ 'test subject' ], 'x-another-header': [ 'test' ] },
what: 'Header with the body'
},
].forEach(function(v) {
var result;

Loading…
Cancel
Save