aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2018-08-03 02:02:01 +0200
committerChocobozzz <me@florianbigard.com>2018-08-08 09:22:15 +0200
commitaad0ec24e886a93c5f85cbb8eb4c31ff5e973e1a (patch)
tree6a54425465578ddc1c6d5a3bc9c220d3653b5722 /server/controllers
parent9a12f169c15b638fe78cf6e85a1993550a25e404 (diff)
downloadPeerTube-aad0ec24e886a93c5f85cbb8eb4c31ff5e973e1a.tar.gz
PeerTube-aad0ec24e886a93c5f85cbb8eb4c31ff5e973e1a.tar.zst
PeerTube-aad0ec24e886a93c5f85cbb8eb4c31ff5e973e1a.zip
advertising PeerTube's rather simple DNT policy
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/static.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index 3ccf624a7..2a92810f3 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -1,4 +1,5 @@
1import * as cors from 'cors' 1import * as cors from 'cors'
2import { createReadStream } from 'fs'
2import * as express from 'express' 3import * as express from 'express'
3import { CONFIG, STATIC_DOWNLOAD_PATHS, STATIC_MAX_AGE, STATIC_PATHS, ROUTE_CACHE_LIFETIME } from '../initializers' 4import { CONFIG, STATIC_DOWNLOAD_PATHS, STATIC_MAX_AGE, STATIC_PATHS, ROUTE_CACHE_LIFETIME } from '../initializers'
4import { VideosPreviewCache } from '../lib/cache' 5import { VideosPreviewCache } from '../lib/cache'
@@ -93,10 +94,26 @@ staticRouter.use('/.well-known/nodeinfo',
93 } 94 }
94) 95)
95staticRouter.use('/nodeinfo/:version.json', 96staticRouter.use('/nodeinfo/:version.json',
96 // asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)), 97 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)),
97 asyncMiddleware(generateNodeinfo) 98 asyncMiddleware(generateNodeinfo)
98) 99)
99 100
101// dnt-policy.txt service (see https://www.eff.org/dnt-policy)
102staticRouter.use('/.well-known/dnt-policy.txt',
103 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.DNT_POLICY)),
104 (_, res: express.Response) => {
105 res.type('text/plain')
106 createReadStream('./server/static/dnt-policy/dnt-policy-1.0.txt').pipe(res)
107 }
108)
109
110// dnt service (see https://www.w3.org/TR/tracking-dnt/#status-resource)
111staticRouter.use('/.well-known/dnt/',
112 (_, res: express.Response) => {
113 res.json({ tracking: 'N' })
114 }
115)
116
100// --------------------------------------------------------------------------- 117// ---------------------------------------------------------------------------
101 118
102export { 119export {