Docly Developers
Knowledge base Pitfall Active

data-antispam loads Turnstile from security.docly.net

In shortA form with data-antispam="on" loads Docly's own Turnstile widget from security.docly.net, not from challenges.cloudflare.com. A strict Content-Security-Policy must allow that host in script-src and frame-src, or the widget is blocked and every submission is refused with "Antispam verification is required for this form."
Applies to FormsContent-Security-PolicySecurity headers
  1. What you'll see

    You protect a form with data-antispam="on" and run the site with a strict CSP. Because the Turnstile article lists challenges.cloudflare.com as the host to allow, that is what you add. The widget never appears, the browser console reports a CSP violation, and every submission fails.

  2. What's actually happening

    There are two Turnstile routes, and they load from different hosts:

    • Your own keys (data-validate with #/Config, see Protect every form with Turnstile): the page loads https://challenges.cloudflare.com/turnstile/v0/api.js.
    • The platform's antispam (data-antispam="on", no keys): the submit script loads the widget from https://security.docly.net, which also serves the iframe.

    Measured 2026-11-28 on two sites with an enforced policy without unsafe-inline: with security.docly.net allowed in script-src and frame-src the console was clean and the A+ headers were kept. A submission without a token was refused with 403 «Antispam verification is required for this form.», and an invalid token with 403 «invalid-input-response».

  3. What to do

    For data-antispam="on", allow exactly this host. One named host does not weaken the A+ rating:

    "Content-Security-Policy": "default-src 'self'; script-src 'self' https://security.docly.net; frame-src https://security.docly.net; style-src 'self'; img-src 'self' data:; form-action 'self'; base-uri 'self'; object-src 'none'"

    Load the submit script from your own origin: <script src="/vanilla.submitform.js"></script>. Docly serves it. Test only the rejection paths - the success path mails a real recipient.

Last reviewed 28 Nov 2026