mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🚫🔍 feat: disallow search indexing (#1409)
* feat: disallow search indexing * Update index.js * Update .env.example * added middleware
This commit is contained in:
parent
c3d5a08b26
commit
bd4d23d314
4 changed files with 18 additions and 0 deletions
11
api/server/middleware/noIndex.js
Normal file
11
api/server/middleware/noIndex.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
const noIndex = (req, res, next) => {
|
||||
const shouldNoIndex = process.env.NO_INDEX ? process.env.NO_INDEX === 'true' : true;
|
||||
|
||||
if (shouldNoIndex) {
|
||||
res.setHeader('X-Robots-Tag', 'noindex');
|
||||
}
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
module.exports = noIndex;
|
||||
Loading…
Add table
Add a link
Reference in a new issue