From 6f3b502e6567b31b3c5f00866d62c7a301bc5c70 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sat, 22 Feb 2020 19:46:36 -0500 Subject: [PATCH] Add 'X-Robots-Tag: noindex' header to invite URLs This instructs search engines to not index invite links. --- invites.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/invites.go b/invites.go index d5d024a..c1c7d95 100644 --- a/invites.go +++ b/invites.go @@ -170,6 +170,9 @@ func handleViewInvite(app *App, w http.ResponseWriter, r *http.Request) error { p.Error = "This invite link has expired." } + // Tell search engines not to index invite links + w.Header().Set("X-Robots-Tag", "noindex") + // Get error messages session, err := app.sessionStore.Get(r, cookieName) if err != nil {