0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-17 23:11:29 -05:00

fix: dev redirect needs to ignore base default of ./

This commit is contained in:
Tony Sullivan 2022-04-20 16:47:49 +02:00
parent a9132217eb
commit 49934fa565

View file

@ -112,7 +112,8 @@ async function handle404Response(
html = subpathNotUsedTemplate(devRoot, pathname);
} else {
// HACK: redirect without the base path for assets in publicDir
if (config.base && !pathname.startsWith(config.base)) {
if (config.base && config.base !== './' && !pathname.startsWith(config.base)) {
console.log('REDIRECT::', pathname, config.base, pathname.replace(config.base, ''));
const response = new Response(null, {
status: 301,
headers: {