Skip to content

Commit

Permalink
fix response validation memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Aug 5, 2020
1 parent 23ec43d commit 4b2cdf1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/middlewares/openapi.response.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export class ResponseValidator {
return this.buildValidators(responses);
}

const key = `${req.method}-${req.originalUrl}-${contentType}`;
const openapi = <OpenApiRequestMetadata>req.openapi;
const key = `${req.method}-${openapi.expressRoute}-${contentType}`;

let validators = this.validatorsCache[key];
if (!validators) {
Expand Down

0 comments on commit 4b2cdf1

Please sign in to comment.