Skip to content

Commit

Permalink
Merge pull request #345 from cdimascio/cdimascio/344/leak
Browse files Browse the repository at this point in the history
fix response validation memory leak #344
  • Loading branch information
cdimascio authored Aug 6, 2020
2 parents 5b88467 + 4b2cdf1 commit 5b96b09
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 5b96b09

Please sign in to comment.