mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix: disallow robots on non-master domains
This commit is contained in:
1 parent
36738f57a9
commit
1524b9a35d
2 files changed
+5
-2
No files matched your search
@@ -1,9 +1,12 @@
|
||||
import type { APIContext } from 'astro';
|
||||
|
||||
const ALLOW_ROBOTS = import.meta.env.ALLOW_ROBOTS === 'true';
|
||||
|
||||
export async function GET({ request }: APIContext) {
|
||||
const flags: Record<string, string | null> = {
|
||||
'User-agent': '*',
|
||||
Allow: '/',
|
||||
Allow: ALLOW_ROBOTS ? '/' : null,
|
||||
Disallow: ALLOW_ROBOTS ? null : '/',
|
||||
|
||||
space: null,
|
||||
Sitemap: `${new URL(request.url).origin}/sitemap-index.xml`,
|
||||
|
||||
Reference in new issue
Block a user