From 8d5f51932a5bdf6970595950f35c70e433117963 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Sat, 1 Feb 2025 21:04:56 -0600 Subject: [PATCH] Respect sec-gpc header as dnt alternative --- src/stats.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stats.js b/src/stats.js index a5e5864..43fbdff 100644 --- a/src/stats.js +++ b/src/stats.js @@ -90,7 +90,9 @@ if (!environment.isTest) { } const handleRequest = (req) => { - if (req.headers['dnt'] !== '1') { + // We will interpret these headers as a sign that the user is privacy-conscious and doesn't + // want to be tracked at all. This isn't really tracking but we will respect them anyways. + if (req.headers['dnt'] !== '1' && req.headers['sec-gpc'] !== '1') { const ip = req.ip; uniques.add(ip); }