Adding robots.txt override via admin control panel
This is a requested low priority feature in #418 - I created the changes to follow similarly to how the Instance Description is handled.
This commit is contained in:
@@ -488,7 +488,14 @@ export class ClientServerService {
|
||||
});
|
||||
|
||||
fastify.get('/robots.txt', async (request, reply) => {
|
||||
return await reply.sendFile('/robots.txt', staticAssets);
|
||||
if (this.meta.robotsTxt) {
|
||||
let content = '';
|
||||
content += this.meta.robotsTxt;
|
||||
reply.header('Content-Type', 'text/plain');
|
||||
return await reply.send(content);
|
||||
} else {
|
||||
return await reply.sendFile('/robots.txt', staticAssets);
|
||||
}
|
||||
});
|
||||
|
||||
// OpenSearch XML
|
||||
|
||||
Reference in New Issue
Block a user