diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-08 11:06:02 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-08 11:06:40 +0200 |
commit | 655c957cc3004c4b4841538486f009511573cdf2 (patch) | |
tree | 822241e6136171b6866201933a5207ecf6b834a1 /server/middlewares | |
parent | 4d3e611dd2764d1d5d0a7e777312631e1e7005d4 (diff) | |
download | PeerTube-655c957cc3004c4b4841538486f009511573cdf2.tar.gz PeerTube-655c957cc3004c4b4841538486f009511573cdf2.tar.zst PeerTube-655c957cc3004c4b4841538486f009511573cdf2.zip |
Stop indexing /about/peertube
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/index.ts | 1 | ||||
-rw-r--r-- | server/middlewares/robots.ts | 13 |
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' | |||
4 | export * from './async' | 4 | export * from './async' |
5 | export * from './auth' | 5 | export * from './auth' |
6 | export * from './pagination' | 6 | export * from './pagination' |
7 | export * from './robots' | ||
7 | export * from './servers' | 8 | export * from './servers' |
8 | export * from './sort' | 9 | export * from './sort' |
9 | export * from './user-right' | 10 | export * 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 @@ | |||
1 | import express from 'express' | ||
2 | |||
3 | function 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 | |||
11 | export { | ||
12 | disableRobots | ||
13 | } | ||