Skip to content

Commit

Permalink
simplify historyApiHandler check
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Apr 2, 2024
1 parent 5c32a14 commit d673e71
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,11 @@ export class Server extends AbstractServer {
headers: { accept },
} = req;
if (
method !== 'GET' ||
!accept ||
accept.startsWith('application/json') ||
!(accept.includes('text/html') || accept.includes('*/*'))
method === 'GET' &&
accept &&
(accept.includes('text/html') || accept.includes('*/*')) &&
!nonUIRoutesRegex.test(req.path)
) {
return next();
}

if (!nonUIRoutesRegex.test(req.path)) {
req.url = '/index.html';
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
securityHeadersMiddleware(req, res, () => {
Expand Down

0 comments on commit d673e71

Please sign in to comment.