Skip to content

Commit 986c4ca

Browse files
committed
fix(security): undefined variable next referenced in route erro
The GET /schema route handler's function signature is `(req, res)` (only two parameters), but the catch block calls `next(err)`. Since `next` is not defined in this scope, this will throw a `ReferenceError` at runtime when an error occurs, potentially crashing the process or causing an unhandled rejection instead of properly returning an error response. Affected files: schema.js Signed-off-by: Trần Bách <45133811+barttran2k@users.noreply.github.com>
1 parent 34374cb commit 986c4ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/routes/schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ router
1818
/**
1919
* GET /schema
2020
*/
21-
.get(async (req, res) => {
21+
.get(async (req, res, next) => {
2222
try {
2323
const swaggerJSON = await getCompiledSchema();
2424

0 commit comments

Comments
 (0)