aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-08 11:06:02 +0200
committerChocobozzz <me@florianbigard.com>2021-10-11 09:37:26 +0200
commit42cc1887afc80e10ff40675621fe683c76537a18 (patch)
tree6409fb274d881e097095de9231e9be66199a2436 /server/middlewares
parent32e06ca4de8480e3b6d4542ef5cd7381b3795465 (diff)
downloadPeerTube-42cc1887afc80e10ff40675621fe683c76537a18.tar.gz
PeerTube-42cc1887afc80e10ff40675621fe683c76537a18.tar.zst
PeerTube-42cc1887afc80e10ff40675621fe683c76537a18.zip
Stop indexing /about/peertube
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/index.ts1
-rw-r--r--server/middlewares/robots.ts13
2 files changed, 14 insertions, 0 deletions
diff --git a/server/middlewares/index.ts b/server/middlewares/index.ts
index a0035f623..d2ed079b6 100644
--- a/server/middlewares/index.ts
+++ b/server/middlewares/index.ts
@@ -4,6 +4,7 @@ export * from './activitypub'
4export * from './async' 4export * from './async'
5export * from './auth' 5export * from './auth'
6export * from './pagination' 6export * from './pagination'
7export * from './robots'
7export * from './servers' 8export * from './servers'
8export * from './sort' 9export * from './sort'
9export * from './user-right' 10export * from './user-right'
diff --git a/server/middlewares/robots.ts b/server/middlewares/robots.ts
new file mode 100644
index 000000000..b22b24a9f
--- /dev/null
+++ b/server/middlewares/robots.ts
@@ -0,0 +1,13 @@
1import express from 'express'
2
3function disableRobots (req: express.Request, res: express.Response, next: express.NextFunction) {
4 res.setHeader('X-Robots-Tag', 'noindex')
5
6 return next()
7}
8
9// ---------------------------------------------------------------------------
10
11export {
12 disableRobots
13}