aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/dnt.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-18 15:41:47 +0200
committerChocobozzz <me@florianbigard.com>2022-07-18 15:41:47 +0200
commitcace0d1a71c266b0b60c159f0ed08011f40ad951 (patch)
treee402679d79fa3b30072d09c683e8b559bb5911c5 /server/middlewares/dnt.ts
parentace01da3480e0de943cb028f9541790e0a015eb4 (diff)
downloadPeerTube-cace0d1a71c266b0b60c159f0ed08011f40ad951.tar.gz
PeerTube-cace0d1a71c266b0b60c159f0ed08011f40ad951.tar.zst
PeerTube-cace0d1a71c266b0b60c159f0ed08011f40ad951.zip
Prevent headers sent error
Diffstat (limited to 'server/middlewares/dnt.ts')
-rw-r--r--server/middlewares/dnt.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/middlewares/dnt.ts b/server/middlewares/dnt.ts
index dd88005dd..a128aadf7 100644
--- a/server/middlewares/dnt.ts
+++ b/server/middlewares/dnt.ts
@@ -1,5 +1,10 @@
1const advertiseDoNotTrack = (_, res, next) => { 1import * as express from 'express'
2 res.setHeader('Tk', 'N') 2
3const advertiseDoNotTrack = (_, res: express.Response, next: express.NextFunction) => {
4 if (!res.headersSent) {
5 res.setHeader('Tk', 'N')
6 }
7
3 return next() 8 return next()
4} 9}
5 10