From 655c957cc3004c4b4841538486f009511573cdf2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 8 Oct 2021 11:06:02 +0200 Subject: Stop indexing /about/peertube --- server/middlewares/index.ts | 1 + server/middlewares/robots.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 server/middlewares/robots.ts (limited to 'server/middlewares') 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' export * from './async' export * from './auth' export * from './pagination' +export * from './robots' export * from './servers' export * from './sort' 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 @@ +import express from 'express' + +function disableRobots (req: express.Request, res: express.Response, next: express.NextFunction) { + res.setHeader('X-Robots-Tag', 'noindex') + + return next() +} + +// --------------------------------------------------------------------------- + +export { + disableRobots +} -- cgit v1.2.3