Skip to content

Commit 342f269

Browse files
committed
fix: add back the default 404 response from the router endpoint
1 parent 28b5353 commit 342f269

File tree

1 file changed

+5
-0
lines changed
  • packages/core/server/controllers

1 file changed

+5
-0
lines changed

packages/core/server/controllers/core.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ export default {
7575
// Find related entity by path.
7676
const { entity, contentType } = await getPluginService('url-alias').findRelatedEntity(path as string, searchQuery);
7777

78+
if (!entity) {
79+
ctx.notFound();
80+
return;
81+
}
82+
7883
// Check 'find' permissions for the content type we're querying.
7984
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
8085
await strapi.auth.verify(auth, { scope: [`${contentType}.find`] });

0 commit comments

Comments
 (0)