The contact form answered 502 on staging, the email provider saw no request and all 57 tests were green. The cause was a single line that called fetch as a method, which the Workers runtime rejects and Node does not.
Replacing a browser-side email service with a Cloudflare Worker endpoint. Every request goes through size limits, strict validation, a honeypot, rate limiting and server-side Turnstile before a single email is sent.
Cloudflare Workers
API Security
Turnstile
TypeScript
$ less hardening-contact-form-cloudflare-workers.md
zsh — simo@devtab complete · ↑ history · esc close