integration: return HTTP 404 for unmatched URLs and close remaining browser-gate gaps

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-25 18:45:28 +02:00
parent 34367181d2
commit 271df12334
8 changed files with 77 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
import { RenderMode } from '@angular/ssr';
import { serverRoutes } from './app.routes.server';
describe('server routes', () => {
it('returns HTTP 404 from the catch-all and leaves prerendered routes without a status', () => {
const catchAll = serverRoutes.find((route) => route.path === '**');
expect(catchAll?.renderMode).toBe(RenderMode.Server);
expect(catchAll && 'status' in catchAll ? catchAll.status : undefined).toBe(404);
const prerendered = serverRoutes.filter((route) => route.path !== '**');
expect(prerendered.length).toBeGreaterThan(0);
for (const route of prerendered) {
expect(route.renderMode, route.path).toBe(RenderMode.Prerender);
expect('status' in route, `${route.path} must not set status`).toBe(false);
}
});
});

View File

@@ -9,5 +9,6 @@ export const serverRoutes: ServerRoute[] = [
{
path: '**',
renderMode: RenderMode.Server,
status: 404,
},
];