fix: robots.txt

This commit is contained in:
dsrkafuu 2022-03-13 21:07:09 +08:00
parent e6b6f547bb
commit 409dbbca3f
1 changed files with 8 additions and 2 deletions

View File

@ -4,8 +4,14 @@ import { genResponse } from '../response';
* @param {Request} req
*/
export async function get(req) {
const robots = 'User-agent: *\nDisallow: /';
return await genResponse(req, robots, {
const robots = [
'User-agent: *',
'Allow: /robots.txt$',
'Allow: /favicon.ico$',
'Allow: /$',
'Disallow: /',
];
return await genResponse(req, robots.join('\n'), {
status: 200,
headers: {
'Content-Type': 'text/plain; charset=utf-8',