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
memfd
Manos Pitsidianakis 2020-01-02 00:08:39 +02:00
parent 8694278369
commit 6671fe926e
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 7 additions and 4 deletions

View File

@ -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)