mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
LibIMAP: Stop parsing immediately on error
This makes the parser more resilient to invalid IMAP messages. Usages of `Optional` have also been removed where the empty case is equivalent to an empty object.
This commit is contained in:
parent
29c477598c
commit
54a28afc13
5 changed files with 333 additions and 314 deletions
|
@ -125,12 +125,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
.first()
|
||||
.get<IMAP::FetchResponseData>()
|
||||
.body_data()
|
||||
.find_if([](Tuple<IMAP::FetchCommand::DataItem, Optional<DeprecatedString>>& data) {
|
||||
.find_if([](Tuple<IMAP::FetchCommand::DataItem, DeprecatedString>& data) {
|
||||
const auto data_item = data.get<0>();
|
||||
return data_item.section.has_value() && data_item.section->type == IMAP::FetchCommand::DataItem::SectionType::HeaderFields;
|
||||
})
|
||||
->get<1>()
|
||||
.value());
|
||||
->get<1>());
|
||||
}
|
||||
|
||||
// FIXME: There is a discrepancy between IMAP::Sequence wanting signed ints
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue