fix: handle 301/302 in dev server (#293)
This commit is contained in:
parent
deb90dc1d2
commit
a2594ef572
1 changed files with 7 additions and 0 deletions
|
@ -47,6 +47,13 @@ export default async function dev(astroConfig: AstroConfig) {
|
|||
res.end();
|
||||
break;
|
||||
}
|
||||
case 301:
|
||||
case 302: {
|
||||
res.statusCode = result.statusCode;
|
||||
res.setHeader('Location', result.location);
|
||||
res.end();
|
||||
break;
|
||||
}
|
||||
case 404: {
|
||||
const fullurl = new URL(req.url || '/', astroConfig.buildOptions.site || `http://localhost${astroConfig.devOptions.port}`);
|
||||
const reqPath = decodeURI(fullurl.pathname);
|
||||
|
|
Loading…
Reference in a new issue