Skip to content

Commit 9ae019f

Browse files
committed
fix(platform-express) make check for already registered parsers work with Express 5
Express 5 made the router public API again and renamed the field from app._router to app.router. This broke the detection mechanism whether a middleware named "jsonParser" or "urlencodedParser" is already re or not, because app._router no longer exists.
1 parent 29aeadb commit 9ae019f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/platform-express/adapters/express-adapter.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,9 @@ export class ExpressAdapter extends AbstractHttpAdapter<
471471
const app = this.getInstance();
472472
return (
473473
!!app._router &&
474-
!!app._router.stack &&
475-
isFunction(app._router.stack.filter) &&
476-
app._router.stack.some(
474+
!!app.router.stack &&
475+
isFunction(app.router.stack.filter) &&
476+
app.router.stack.some(
477477
(layer: any) => layer && layer.handle && layer.handle.name === name,
478478
)
479479
);

0 commit comments

Comments
 (0)