Skip to content
Snippets Groups Projects
Commit 2d416efe authored by rswindell's avatar rswindell
Browse files

convert_msg_header() fixes:

Reference the header field name (f) correctly (copy/pasted "line" from
newsutil.js).
Removed unnecessary reassignment of header field array element.
Return newly created object instead of adding properties to passed array.
Can you tell I'm not actually testing these modifications? :-)
parent 27046e09
Branches
Tags
No related merge requests found
......@@ -31,10 +31,12 @@ function parse_msg_header(msgtxt)
}
// Convert a parsed RFC822 message header field array into a Synchronet-compatible header object
function convert_msg_header(hdr)
function convert_msg_header(hdr_array)
{
for(f in hdr) {
var data = hdr[f];
var hdr = new Object;
for(f in hdr_array) {
var data = hdr_array[f];
switch(f) {
case "to":
case "apparently-to":
......@@ -101,10 +103,9 @@ function convert_msg_header(hdr)
hdr.field_list=new Array();
hdr.field_list.push(
{ type: RFC822HEADER,
data: line + ": " + data
data: f + ": " + data
}
);
hdr[line.toLowerCase()]=data;
break;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment