Skip to content

Commit

Permalink
Respect sec-gpc header as dnt alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Feb 2, 2025
1 parent 8c07a3d commit 8d5f519
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8d5f519

Please # to comment.