mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-23 21:34:10 +02:00
fix(backend): robots.txtで返却する内容の調整 (#17165)
* fix(backend): robots.txtで返却する内容の調整 * Update Changelog * fix: add paths * Update Changleog
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
- Fix: support `alsoKnownAs` from remote actors as either array or unwrapped singleton
|
- Fix: support `alsoKnownAs` from remote actors as either array or unwrapped singleton
|
||||||
- Fix: ローカルに存在しないリモートアカウントに対するアカウント削除リクエストを受信した際に、そのユーザーを新規作成して削除する挙動を修正
|
- Fix: ローカルに存在しないリモートアカウントに対するアカウント削除リクエストを受信した際に、そのユーザーを新規作成して削除する挙動を修正
|
||||||
- Fix: ID生成アルゴリズムにULIDを使用している場合にMisskeyが正しく動作しない問題を修正
|
- Fix: ID生成アルゴリズムにULIDを使用している場合にMisskeyが正しく動作しない問題を修正
|
||||||
|
- Fix: robots.txtの内容を調整
|
||||||
|
|
||||||
## 2026.3.2
|
## 2026.3.2
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
user-agent: *
|
|
||||||
allow: /
|
|
||||||
|
|
||||||
# todo: sitemap
|
|
||||||
@@ -396,7 +396,34 @@ export class ClientServerService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
fastify.get('/robots.txt', async (request, reply) => {
|
fastify.get('/robots.txt', async (request, reply) => {
|
||||||
return await reply.sendFile('/robots.txt', staticAssets);
|
const disallowedPaths = [
|
||||||
|
'/settings',
|
||||||
|
'/admin',
|
||||||
|
'/custom-emojis-manager',
|
||||||
|
'/avatar-decorations',
|
||||||
|
'/share',
|
||||||
|
'/my',
|
||||||
|
'/api',
|
||||||
|
'/inbox',
|
||||||
|
'/oauth',
|
||||||
|
'/proxy',
|
||||||
|
'/url',
|
||||||
|
];
|
||||||
|
|
||||||
|
if (this.meta.ugcVisibilityForVisitor === 'none') {
|
||||||
|
disallowedPaths.push(
|
||||||
|
'/@',
|
||||||
|
'/notes',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let content = `User-agent: *\n`;
|
||||||
|
content += disallowedPaths.map((path) => `Disallow: ${path}`).join('\n') + '\n';
|
||||||
|
content += 'Allow: /\n';
|
||||||
|
content += '\n# todo: sitemap\n';
|
||||||
|
|
||||||
|
reply.header('Content-Type', 'text/plain; charset=utf-8');
|
||||||
|
return await reply.send(content);
|
||||||
});
|
});
|
||||||
|
|
||||||
// OpenSearch XML
|
// OpenSearch XML
|
||||||
|
|||||||
Reference in New Issue
Block a user