summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorKinetix <kinetix@isurf.ca>2025-01-31 10:22:13 -0800
committerKinetix <kinetix@isurf.ca>2025-01-31 10:22:13 -0800
commit4d91baaa13a8c4e8b9df221ce710d7005102c5a3 (patch)
treee24a5cedc9aa2d2abc3869a71219825b73314405 /packages
parentMerge remote-tracking branch 'upstream/develop' into configrobotstxt (diff)
downloadsharkey-4d91baaa13a8c4e8b9df221ce710d7005102c5a3.tar.gz
sharkey-4d91baaa13a8c4e8b9df221ce710d7005102c5a3.tar.bz2
sharkey-4d91baaa13a8c4e8b9df221ce710d7005102c5a3.zip
Adjust as per suggestions in !877
Diffstat (limited to 'packages')
-rw-r--r--packages/backend/migration/1738346484187-robotsTxt.js (renamed from packages/backend/migration/1738098171990-robotsTxt.js)6
-rw-r--r--packages/backend/src/server/web/ClientServerService.ts4
2 files changed, 4 insertions, 6 deletions
diff --git a/packages/backend/migration/1738098171990-robotsTxt.js b/packages/backend/migration/1738346484187-robotsTxt.js
index 947f21cc46..00ea1fb030 100644
--- a/packages/backend/migration/1738098171990-robotsTxt.js
+++ b/packages/backend/migration/1738346484187-robotsTxt.js
@@ -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) {
diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts
index e93900b358..ae923ada1f 100644
--- a/packages/backend/src/server/web/ClientServerService.ts
+++ b/packages/backend/src/server/web/ClientServerService.ts
@@ -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);
}