Adjust as per suggestions in !877

This commit is contained in:
Kinetix 2025-01-31 10:22:13 -08:00
parent bf1f263d72
commit 4d91baaa13
2 changed files with 4 additions and 6 deletions

View file

@ -3,11 +3,11 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class RobotsTxt1738098171990 {
name = 'RobotsTxt1738098171990'
export class RobotsTxt1738346484187 {
name = 'RobotsTxt1738346484187'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "robotsTxt" character varying(2048)`);
await queryRunner.query(`ALTER TABLE "meta" ADD "robotsTxt" text`);
}
async down(queryRunner) {

View file

@ -489,10 +489,8 @@ export class ClientServerService {
fastify.get('/robots.txt', async (request, reply) => {
if (this.meta.robotsTxt) {
let content = '';
content += this.meta.robotsTxt;
reply.header('Content-Type', 'text/plain');
return await reply.send(content);
return await reply.send(this.meta.robotsTxt);
} else {
return await reply.sendFile('/robots.txt', staticAssets);
}