fix: close input normalization aliases

This commit is contained in:
2026-09-02 00:44:38 +03:00
parent 0a34f90bb9
commit 6428b5dcd6
4 changed files with 26 additions and 3 deletions

View File

@@ -208,8 +208,7 @@ const siteConfigSchema = z.object({
canonicalUrl: httpUrl,
buildId: z.string().regex(/^[a-z0-9][a-z0-9._-]{0,127}$/, 'Build ID must be a safe immutable identifier.'),
}).strict().superRefine((site, context) => {
const url = new URL(site.canonicalUrl);
if (site.environment === 'preview' && (url.hostname !== 'portfolio.localhost' || url.port || url.pathname !== '/')) {
if (site.environment === 'preview' && site.canonicalUrl !== 'https://portfolio.localhost/') {
context.addIssue({ code: 'custom', message: 'Preview canonical URL must be exactly https://portfolio.localhost/.', path: ['canonicalUrl'] });
}
if (site.environment === 'production') {