Skip to content

Commit dcd0521

Browse files
committed
plain-connect: use meta name=referrer in support form example
referrerpolicy isn't valid on <form> — browsers ignore it. Document the meta tag override instead, which actually works.
1 parent 73d1cce commit dcd0521

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

plain-connect/plain/connect/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,8 @@ The same `CONNECT_SECRET_KEY` is used by the `{% connect_support_fields %}` widg
9595
plain.connect ships a tag for sending contact-form submissions to a support endpoint on Plain Cloud. You create the endpoint in the App's Support settings (it gives you an id like `plain_sf_abc123`), then drop a normal HTML form into your template:
9696

9797
```html
98-
<form
99-
action="{{ connect_support_url('plain_sf_abc123') }}"
100-
method="POST"
101-
referrerpolicy="strict-origin-when-cross-origin"
102-
>
98+
<meta name="referrer" content="strict-origin-when-cross-origin">
99+
<form action="{{ connect_support_url('plain_sf_abc123') }}" method="POST">
103100
{% connect_support_fields %}
104101
<input name="name" placeholder="Your name">
105102
<input name="email" type="email" placeholder="Email">
@@ -120,7 +117,7 @@ Both anti-spam signals require `CONNECT_SECRET_KEY`. Without it the inputs still
120117

121118
The form posts cross-origin to Plain Cloud, so the browser's `Origin` header serialization is governed by the page's `Referrer-Policy`. Plain ships `Referrer-Policy: same-origin` by default, which causes Chrome and Firefox to send `Origin: null` on no-cors cross-origin POSTs — and Plain Cloud rejects submissions with a null origin.
122119

123-
Setting `referrerpolicy="strict-origin-when-cross-origin"` on the `<form>` element (as in the example above) overrides the document policy for that submission only, so the browser sends `Origin: https://yourapp.com` and the submission goes through. Your app's global `Referrer-Policy` is unaffected.
120+
The `<meta name="referrer">` tag in the example above overrides the document's policy to `strict-origin-when-cross-origin`, so the browser sends `Origin: https://yourapp.com` and the submission goes through. Putting it in `<head>` is preferable when you can — it applies before any subresources load — but inline next to the form still works for the form submission. Your app's global `Referrer-Policy` header is unaffected.
124121

125122
### Field names
126123

0 commit comments

Comments
 (0)