From 559083bb81cc09587ba3dfc1a2e554f68b92a9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannik=20R=C3=B6del?= Date: Wed, 25 Jan 2023 08:29:23 +0100 Subject: [PATCH] Remove obsolete manual CAPTCHA field handling --- cgi-bin/form.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cgi-bin/form.py b/cgi-bin/form.py index 00d8a22..d74a929 100755 --- a/cgi-bin/form.py +++ b/cgi-bin/form.py @@ -147,12 +147,8 @@ if not hmac.compare_digest(csrf_token, given_csrf_token): # If the honeypot field was not empty, back off. -if ( - get_form_value(HONEYPOT_FIELD_NAME, "") - or get_form_value(CAPTCHA_FIELD_NAME, - "").lower().strip() != CAPTCHA_FIELD_VALUE -): - fail("200 OK", f"Invalid value for field: {CAPTCHA_FIELD_NAME}") +if get_form_value(HONEYPOT_FIELD_NAME, ""): + fail("200 OK", f"Invalid value for field: {HONEYPOT_FIELD_NAME}") if not (hcaptcha_token := get_form_value("h-captcha-response", "")): fail("200 OK", "Empty hCaptcha token")