On this page
A messaging app may request an invitation link to create a preview before the recipient clicks it. If that request consumes a single-use token, the recipient can arrive to find the invitation already used. Before a seasonal campaign, test the flow with disposable links and make the final action an explicit submission rather than a page load.
Key Takeaways
- A preview request is not evidence that a person clicked or accepted an invitation.
- Opening a link with
GETshould display information, not redeem a coupon, accept an invite, or submit an RSVP. - Test using fictional tokens in an isolated environment. Never probe a real invitation, coupon, or payment link.
- A confirmation step reduces accidental consumption, but it is not a complete defense against automated submissions or stolen links.
- Crawler behavior varies by platform and can change; test the actual sharing paths used by your campaign.
Why a preview can consume a link
When someone shares a URL, a messaging or social application may fetch the destination to obtain a title, description, or image. Other automated systems, including security scanners and browser prefetchers, may also request links. These requests can happen before the intended recipient interacts with the message, and a link may be requested more than once.
The risk arises when the server treats a page request as the action itself. For example, a request to an invitation URL might mark its token as used and immediately add someone to an event. A preview fetch can then trigger the same action as a recipient's visit.
HTTP defines GET as a safe method: the client is requesting retrieval, not asking for a state-changing action. Ordinary incidental effects, such as recording a request in a server log, are different from redeeming a token. This distinction is important for crawlers, but using POST alone does not prove that a human intended the action.
Research limitation: RFC 9110 and platform documentation were not available to consult for this article. No particular platform's current preview behavior is assumed here; verify it against the official documentation and your own authorized tests before launch.
Advertisement
Try a controlled one-time link test
This local demonstration compares an unsafe link that consumes a fictional token on GET with a safer flow that waits for POST. It uses Python's standard library and binds only to your computer's loopback interface. The code was not executed for this article.
Save the following as preview_demo.py:
from http.server import BaseHTTPRequestHandler, HTTPServer
used = {"unsafe": False, "safe": False}
class Handler(BaseHTTPRequestHandler):
def reply(self, status, html):
body = html.encode("utf-8")
self.send_response(status)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.send_header("Content-Length", str(len(body)))
self.send_header("Connection", "close")
self.end_headers()
self.wfile.write(body)
self.close_connection = True
def do_GET(self):
if self.path == "/unsafe/demo":
if used["unsafe"]:
return self.reply(410, "Unsafe demo token already used.")
used["unsafe"] = True # Intentionally wrong: GET consumes it.
return self.reply(200, "Unsafe demo token consumed.")
if self.path == "/safe/demo":
if used["safe"]:
return self.reply(410, "Safe demo token already used.")
return self.reply(
200,
'<p>Demo invitation. No action has been completed.</p>'
'<form method="post" action="/safe/demo">'
'<button type="submit">Confirm demo invitation</button>'
'</form>',
)
self.reply(404, "Not found.")
def do_POST(self):
if self.path != "/safe/demo":
return self.reply(404, "Not found.")
if used["safe"]:
return self.reply(410, "Safe demo token already used.")
used["safe"] = True
self.reply(200, "Safe demo invitation confirmed.")
if __name__ == "__main__":
server = HTTPServer(("127.0.0.1", 8000), Handler)
try:
server.serve_forever()
except KeyboardInterrupt:
pass
finally:
server.server_close()
Start it with python3 preview_demo.py. In a second terminal, use curl to simulate repeated page requests and a confirmation:
curl -i http://127.0.0.1:8000/unsafe/demo
curl -i http://127.0.0.1:8000/unsafe/demo
curl -i http://127.0.0.1:8000/safe/demo
curl -i http://127.0.0.1:8000/safe/demo
curl -i -X POST http://127.0.0.1:8000/safe/demo
curl -i -X POST http://127.0.0.1:8000/safe/demo
The first request to the unsafe route is designed to consume its token, so the second should receive an already-used response. Both GET requests to the safe route should leave its token available. The first POST should consume it, and the second should report that it is already used. You can also open the safe URL in a browser and submit its button. Stop the server with Ctrl+C; restarting it resets both tokens.
This is a behavioral illustration, not a production server. It has no real authentication, authorization, expiry, CSRF protection, persistent storage, or concurrency safeguards. Do not expose it to a network or use real tokens.
Advertisement
Design the campaign flow around confirmation
A practical invitation or RSVP flow can separate viewing from commitment:
- Show a landing page on
GET. Explain what the invitation or offer is and what the confirmation button will do. Do not consume the token merely because the page loads, follows a redirect, or requests a preview image. - Confirm with a state-changing request. Submit the user's deliberate action with
POSTor another appropriate non-safe method. Validate the token and its intended scope on the server. - Check eligibility and consume atomically. Where the action is genuinely single-use, ensure concurrent submissions cannot both redeem it. Return a clear already-used or expired state without revealing unnecessary personal information.
- Offer a recovery path. Decide how support can verify a recipient and issue a replacement, and how to revoke the original link. Test the replacement and expiration process before the campaign begins.
Choose safeguards for the action's risk. An authenticated account and an authorization check may be appropriate for a membership invitation; a low-value public coupon may need a simpler flow. Protect authenticated state-changing requests against cross-site request forgery where applicable. For high-impact actions, consider additional confirmation or verification. A visible button is useful friction, not proof of human intent: automation can submit forms, and anyone holding a bearer link may be able to use it.
Treat invitation URLs as secrets when possession grants access. Avoid putting personal details or offer terms that must remain private in preview metadata. Limit exposure of full tokenized URLs in logs, analytics, and referrer information; use short-lived, unpredictable tokens and appropriate expiry and revocation controls. A preview or scanner may still see the URL it requests.
Pre-launch checklist for marketing and product teams
- Create disposable test invitations or offers in a staging environment with no real recipients, value, or payment actions attached.
- Share them through the actual messaging, social, email, and tracking paths planned for the campaign. Record whether a preview appears and whether the token remains usable before a person confirms.
- Check redirects and link-shortening or tracking layers as well as the final landing page. A request to any step in the chain must not accidentally complete the action.
- Inspect privacy-conscious server records for request times, methods, and response statuses. User-agent strings can help investigate, but they can be missing or imitated and do not prove who made a request.
- Test repeated page loads, expired and already-used tokens, concurrent confirmations, and the replacement-link workflow. Include a test in which an authorized person opens and confirms the link after any preview request.
- Repeat the checks when platforms, campaign infrastructure, or the invitation flow changes. An automated system may behave differently from a simple
GETsimulation, including following redirects or submitting requests.
Common Mistakes
- Counting every request as a click. A server request can come from automation; use a deliberate interaction as the event you measure, while recognizing that automation can imitate interactions too.
- Moving redemption to
POSTand stopping there. Validate authorization and token state, and protect the submission according to its risk. - Trusting a crawler's user-agent string. It is not an authentication mechanism and cannot reliably distinguish all automated traffic from people.
- Testing with a valuable live link. A test can consume or expose it. Use disposable, isolated fixtures.
- Assuming previews never repeat requests. Design page loads and redirects so repeated retrievals do not consume the action.
Conclusion
Keep invitation viewing separate from invitation acceptance. A disposable end-to-end test can reveal accidental consumption before a campaign, while explicit confirmation, server-side controls, and a recovery process reduce the impact when automated requests occur.
What would your domain sell for?
A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.