summaryrefslogtreecommitdiff
path: root/lib/response.js
diff options
context:
space:
mode:
authorSheogorath2019-06-08 23:33:34 +0200
committerSheogorath2019-06-08 23:43:50 +0200
commitda4665c7590616dd3d17baf4488006dac98eeee4 (patch)
treeaf1c1e26f28d2f2df998c93d3f1a830175e24018 /lib/response.js
parent6462968e84e8d92292dd23764a9e558d7800147d (diff)
Respect DNT header
Do Not Track (DNT) is an old web standard in order to notify pages that the user doesn't want to be tracked. Even while a lot of pages either ignore this header or even worse, use it for tracking purposes, the orignal intention of this header is good and should be adopted. This patch implements a respect of the DNT header by no longer including the optional Google Analytics and disqus integrations when sending a DNT header. This should reduce outside resource usage and help to stay more private. This should later-on extended towards other document content (i.e. iframe based content). The reason to not change the CDN handling is that CDNs will be deprecated with next release and removed in long term. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to 'lib/response.js')
-rw-r--r--lib/response.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/response.js b/lib/response.js
index dd33e42b..1313f9f4 100644
--- a/lib/response.js
+++ b/lib/response.js
@@ -226,7 +226,8 @@ function showPublishNote (req, res, next) {
robots: meta.robots || false, // default allow robots
GA: meta.GA,
disqus: meta.disqus,
- cspNonce: res.locals.nonce
+ cspNonce: res.locals.nonce,
+ dnt: req.headers.dnt
}
return renderPublish(data, res)
}).catch(function (err) {
@@ -608,7 +609,8 @@ function showPublishSlide (req, res, next) {
robots: meta.robots || false, // default allow robots
GA: meta.GA,
disqus: meta.disqus,
- cspNonce: res.locals.nonce
+ cspNonce: res.locals.nonce,
+ dnt: req.headers.dnt
}
return renderPublishSlide(data, res)
}).catch(function (err) {