Skip to content

Commit

Permalink
fix: incorrectly throw required header in node 15 (cdimascio#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio authored and ex1st committed Dec 9, 2020
1 parent 1ab6c87 commit d4cefc9
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 d4cefc9

Please sign in to comment.