From b490120f60c87141156282500bab025b7e05770f Mon Sep 17 00:00:00 2001 From: anurag629 Date: Fri, 27 Feb 2026 15:39:53 +0530 Subject: [PATCH] fix: add Content-Type header to visitor counter POST request Vercel CSRF protection blocks POST requests without explicit Content-Type: application/json, returning 403 Forbidden. --- src/components/Footer.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 8459d93..b11e817 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -194,7 +194,7 @@ const year = new Date().getFullYear(); function loadVisitors() { // One increment per session if (!sessionStorage.getItem('ogcops-counted')) { - fetch('/api/visitors', { method: 'POST' }) + fetch('/api/visitors', { method: 'POST', headers: { 'Content-Type': 'application/json' } }) .then(function(r) { return r.json(); }) .then(function(data) { sessionStorage.setItem('ogcops-counted', '1');