Skip to content

Commit

Permalink
remove default status that swallows response.status
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Nov 8, 2024
1 parent e10b03e commit c330e35
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/astro/src/vite-plugin-astro-server/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export async function handleRoute({
matchedRoute,
url,
pathname,
status = getStatus(matchedRoute),
status,
body,
origin,
pipeline,
Expand Down Expand Up @@ -298,10 +298,3 @@ export async function handleRoute({
}
await writeSSRResult(request, response, incomingResponse);
}

function getStatus(matchedRoute?: MatchedRoute): 404 | 500 | 200 {
if (!matchedRoute) return 404;
if (matchedRoute.route.route === '/404') return 404;
if (matchedRoute.route.route === '/500') return 500;
return 200;
}

0 comments on commit c330e35

Please sign in to comment.