Skip to content

Commit

Permalink
address test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy committed Jan 18, 2024
1 parent 3252a2b commit 55f0468
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/integrations/node/src/serve-static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export function createStaticHandler(app: NodeApp, options: Options) {
pathname = urlPath.slice(0, -1) + (urlQuery ? "?" + urlQuery : "");
res.statusCode = 301;
res.setHeader('Location', pathname);
return res.end();
} else pathname = urlPath;
// intentionally fall through
case "ignore":
Expand All @@ -52,16 +53,13 @@ export function createStaticHandler(app: NodeApp, options: Options) {
pathname = urlPath + '/' +(urlQuery ? "?" + urlQuery : "");
res.statusCode = 301;
res.setHeader('Location', pathname);
return res.end();
} else
pathname = urlPath;
break;
}
pathname = app.removeBase(pathname);

if (urlQuery && !pathname.includes('?')) {
pathname = pathname + '?' + urlQuery;
}

const stream = send(req, pathname, {
root: client,
dotfiles: pathname.startsWith('/.well-known/') ? 'allow' : 'deny',
Expand Down

0 comments on commit 55f0468

Please sign in to comment.