diff options
author | 2021-06-03 11:55:36 -0500 | |
---|---|---|
committer | 2021-06-03 11:55:36 -0500 | |
commit | a2594ef572c41ce05dd01ef095e8595ffcd35842 (patch) | |
tree | 5f036b293f56dbe40741b8031c63c7ffc728c010 | |
parent | deb90dc1d243420b6dc8cbbe0b2e7ab646a97472 (diff) | |
download | astro-a2594ef572c41ce05dd01ef095e8595ffcd35842.tar.gz astro-a2594ef572c41ce05dd01ef095e8595ffcd35842.tar.zst astro-a2594ef572c41ce05dd01ef095e8595ffcd35842.zip |
fix: handle 301/302 in dev server (#293)
-rw-r--r-- | packages/astro/src/dev.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/astro/src/dev.ts b/packages/astro/src/dev.ts index a7da0c863..4321adfaa 100644 --- a/packages/astro/src/dev.ts +++ b/packages/astro/src/dev.ts @@ -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); |