your personal website on atproto - mirror blento.app

dont show other handles custom domain

+7 -2
+7 -2
src/routes/[actor=actor]/(pages)/+layout.server.ts
··· 2 2 import { env } from '$env/dynamic/private'; 3 3 import { error } from '@sveltejs/kit'; 4 4 import { createCache } from '$lib/cache'; 5 - import type { Handle } from '@atcute/lexicons'; 6 5 7 - export async function load({ params, platform }) { 6 + export async function load({ params, platform, request }) { 8 7 if (env.PUBLIC_IS_SELFHOSTED) error(404); 9 8 10 9 const cache = createCache(platform); 10 + 11 + const customDomain = request.headers.get('X-Custom-Domain'); 12 + 13 + if (customDomain) { 14 + throw error(404, 'Page not found!'); 15 + } 11 16 12 17 return await loadData(params.actor, cache, false, params.page, env); 13 18 }