diff --git a/api/README.md b/api/README.md index 5d7ba4f..98a675c 100644 --- a/api/README.md +++ b/api/README.md @@ -104,6 +104,6 @@ Backup is written even if Telegram fails (`telegram_ok: false`), so you still ha ## Behaviour notes -- Honeypot field `website`: if filled, returns `200` without notifying Telegram or writing a backup. +- Honeypot field `hp_company` (legacy `website` still checked): if filled, returns `200` without notifying Telegram or writing a backup. - In-memory rate limit: 5 POSTs per IP per 60 seconds → `429`. - Field limits: name/contact ≤ 200 chars, message ≤ 4000. diff --git a/api/contact_server.py b/api/contact_server.py index b61c10f..80fbf80 100644 --- a/api/contact_server.py +++ b/api/contact_server.py @@ -114,9 +114,11 @@ def validate_fields(data: dict) -> tuple[str, str, str] | str: return "invalid" # Honeypot — treat as success upstream; caller checks separately. - website = data.get("website", "") - if isinstance(website, str) and website.strip(): - return "honeypot" + # Accept legacy "website" (autofill magnets) and current "hp_company". + for pot in ("hp_company", "website"): + raw_pot = data.get(pot, "") + if isinstance(raw_pot, str) and raw_pot.strip(): + return "honeypot" def field(key: str, max_len: int) -> str | None: raw = data.get(key, "") diff --git a/en/index.html b/en/index.html index cbdddb3..900161b 100644 --- a/en/index.html +++ b/en/index.html @@ -429,8 +429,8 @@