From a03c8bb09cbd36685924a23764cbf6c62c6f00d4 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Tue, 27 Oct 2026 10:42:41 +0100 Subject: [PATCH] openvidu-dashboard: the unknown API route 404 names the full request path --- openvidu-dashboard/dashboard-ce/backend/src/http/errors.ts | 4 +++- .../dashboard-ce/backend/test/unit/http-app.test.ts | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openvidu-dashboard/dashboard-ce/backend/src/http/errors.ts b/openvidu-dashboard/dashboard-ce/backend/src/http/errors.ts index 213ad8371..9dd3a20a5 100644 --- a/openvidu-dashboard/dashboard-ce/backend/src/http/errors.ts +++ b/openvidu-dashboard/dashboard-ce/backend/src/http/errors.ts @@ -14,7 +14,9 @@ export function errorBody(code: ErrorCode, message: string, details?: Record { - res.status(404).json(errorBody('NOT_FOUND', `No API route for ${req.method} ${req.path}`)); + res.status(404).json( + errorBody('NOT_FOUND', `No API route for ${req.method} ${req.originalUrl.split('?')[0] ?? ''}`) + ); }; interface BodyParserError { diff --git a/openvidu-dashboard/dashboard-ce/backend/test/unit/http-app.test.ts b/openvidu-dashboard/dashboard-ce/backend/test/unit/http-app.test.ts index 99cd0d765..64fc2a42a 100644 --- a/openvidu-dashboard/dashboard-ce/backend/test/unit/http-app.test.ts +++ b/openvidu-dashboard/dashboard-ce/backend/test/unit/http-app.test.ts @@ -57,7 +57,10 @@ describe('HTTP contract', () => { const response = await request(app).get(path); expect(response.status).toBe(404); expect(response.headers['content-type']).toContain('application/json'); - expect((response.body as { error: { code: string } }).error.code).toBe('NOT_FOUND'); + expect((response.body as { error: { code: string; message: string } }).error).toEqual({ + code: 'NOT_FOUND', + message: `No API route for GET ${path}` + }); }); it('hides unexpected errors behind INTERNAL_ERROR', async () => {