fix: Return None
if the key not found and not Some(None)
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
parent
d39f1e941a
commit
d4c3558b97
1 changed files with 2 additions and 2 deletions
|
@ -62,15 +62,15 @@ impl CaptchaFinder for CaptchaFormFinder {
|
||||||
async fn find_token(&self, req: &mut Request) -> Option<Option<String>> {
|
async fn find_token(&self, req: &mut Request) -> Option<Option<String>> {
|
||||||
req.form_data()
|
req.form_data()
|
||||||
.await
|
.await
|
||||||
.map(|form| form.fields.get(&self.token_name).cloned())
|
|
||||||
.ok()
|
.ok()
|
||||||
|
.and_then(|form| form.fields.get(&self.token_name).cloned().map(Some))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn find_answer(&self, req: &mut Request) -> Option<Option<String>> {
|
async fn find_answer(&self, req: &mut Request) -> Option<Option<String>> {
|
||||||
req.form_data()
|
req.form_data()
|
||||||
.await
|
.await
|
||||||
.map(|form| form.fields.get(&self.answer_name).cloned())
|
|
||||||
.ok()
|
.ok()
|
||||||
|
.and_then(|form| form.fields.get(&self.answer_name).cloned().map(Some))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue