melib: don't treat missing end boundary as error

Don't treat missing end boundary as error in multipart attachments.

python3's nntplib seems to return MIME attachments with this property
pull/234/head
Manos Pitsidianakis 5 years ago
parent 8694278369
commit 6671fe926e
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -750,9 +750,12 @@ pub fn multipart_parts<'a>(input: &'a [u8], boundary: &[u8]) -> IResult<&'a [u8]
offset += 2;
input = &input[2..];
}
continue;
} else {
return IResult::Error(error_code!(ErrorKind::Custom(43)));
ret.push(StrBuilder {
offset,
length: input.len(),
});
break;
}
}
IResult::Done(input, ret)
@ -805,9 +808,9 @@ fn parts_f<'a>(input: &'a [u8], boundary: &[u8]) -> IResult<&'a [u8], Vec<&'a [u
} else if input[0..].starts_with(b"\r\n") {
input = &input[2..];
}
continue;
} else {
return IResult::Error(error_code!(ErrorKind::Custom(43)));
ret.push(input);
break;
}
}
IResult::Done(input, ret)

Loading…
Cancel
Save