Adjust as per suggestions in !877
This commit is contained in:
parent
bf1f263d72
commit
4d91baaa13
2 changed files with 4 additions and 6 deletions
|
@ -3,11 +3,11 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export class RobotsTxt1738098171990 {
|
export class RobotsTxt1738346484187 {
|
||||||
name = 'RobotsTxt1738098171990'
|
name = 'RobotsTxt1738346484187'
|
||||||
|
|
||||||
async up(queryRunner) {
|
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) {
|
async down(queryRunner) {
|
|
@ -489,10 +489,8 @@ export class ClientServerService {
|
||||||
|
|
||||||
fastify.get('/robots.txt', async (request, reply) => {
|
fastify.get('/robots.txt', async (request, reply) => {
|
||||||
if (this.meta.robotsTxt) {
|
if (this.meta.robotsTxt) {
|
||||||
let content = '';
|
|
||||||
content += this.meta.robotsTxt;
|
|
||||||
reply.header('Content-Type', 'text/plain');
|
reply.header('Content-Type', 'text/plain');
|
||||||
return await reply.send(content);
|
return await reply.send(this.meta.robotsTxt);
|
||||||
} else {
|
} else {
|
||||||
return await reply.sendFile('/robots.txt', staticAssets);
|
return await reply.sendFile('/robots.txt', staticAssets);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue