Skip to content

Commit

Permalink
fix: incorrectly throw required header in node 15 (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio authored Nov 7, 2020
1 parent 33c31f2 commit 80ca68f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/middlewares/openapi.request.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,13 @@ export class RequestValidator {
}
: undefined;

const data = { query: {}, ...req, cookies };
const data = {
query: req.query ?? {},
headers: req.headers,
params: req.params,
cookies,
body: req.body,
}
const valid = validator.validatorGeneral(data);
const validBody = validator.validatorBody(data);

Expand Down

0 comments on commit 80ca68f

Please sign in to comment.