Allow Google's sign-in page as a form target

Connect Search Console posts a form that redirects to accounts.google.com,
which the Content-Security-Policy's form-action didn't list, so browsers
refused it silently. A test now checks every sign-in host is allowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 07:27:39 -07:00
co-authored by Claude Opus 5.5
parent 68ff18690b
commit a7de13087e
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -217,7 +217,7 @@ func (s *Server) guard(next http.Handler) http.Handler {
h.Set("X-Frame-Options", "DENY")
h.Set("X-Content-Type-Options", "nosniff")
h.Set("Referrer-Policy", "same-origin")
h.Set("Content-Security-Policy", "default-src 'self'; img-src 'self' data:; style-src 'self'; script-src 'self'; form-action 'self' https://twitter.com https://x.com https://www.linkedin.com https://www.reddit.com https://old.reddit.com; frame-ancestors 'none'")
h.Set("Content-Security-Policy", "default-src 'self'; img-src 'self' data:; style-src 'self'; script-src 'self'; form-action 'self' https://twitter.com https://x.com https://www.linkedin.com https://www.reddit.com https://old.reddit.com https://accounts.google.com; frame-ancestors 'none'")
next.ServeHTTP(w, r)
})
}