mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59: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
@@ -19,7 +19,7 @@ concurrency:
|
|||||||
env:
|
env:
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
ALLOW_ROBOTS: 'true'
|
ALLOW_ROBOTS: ${{ secrets.ALLOW_ROBOTS }}
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import type { APIContext } from 'astro';
|
import type { APIContext } from 'astro';
|
||||||
|
|
||||||
|
const ALLOW_ROBOTS = import.meta.env.ALLOW_ROBOTS === 'true';
|
||||||
|
|
||||||
export async function GET({ request }: APIContext) {
|
export async function GET({ request }: APIContext) {
|
||||||
const flags: Record<string, string | null> = {
|
const flags: Record<string, string | null> = {
|
||||||
'User-agent': '*',
|
'User-agent': '*',
|
||||||
Allow: '/',
|
Allow: ALLOW_ROBOTS ? '/' : null,
|
||||||
|
Disallow: ALLOW_ROBOTS ? null : '/',
|
||||||
|
|
||||||
space: null,
|
space: null,
|
||||||
Sitemap: `${new URL(request.url).origin}/sitemap-index.xml`,
|
Sitemap: `${new URL(request.url).origin}/sitemap-index.xml`,
|
||||||
|
|||||||
Reference in new issue
Block a user