Skip to content

Commit

Permalink
Make sure OCSP linter is only created once
Browse files Browse the repository at this point in the history
  • Loading branch information
mans-andersson committed Apr 5, 2024
1 parent 6415930 commit 12a7c85
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkilint/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
cabf_smime.create_linter_group_instance(),
cabf_serverauth.create_linter_group_instance(),
]
_OCSP_PKIX_LINTER = ocsp.create_ocsp_response_linter()


@app.get('/version')
Expand Down Expand Up @@ -107,8 +108,6 @@ def ocsp_linter_validations() -> List[model.Validation]:
def ocsp_response_lint(doc: model.OcspResponseModel) -> model.LintResultList:
"""Lints the specified OCSP response"""

linter = ocsp.create_ocsp_response_linter()

parsed_doc = doc.parsed_document

return linter.lint(parsed_doc)
return _OCSP_PKIX_LINTER.lint(parsed_doc)

0 comments on commit 12a7c85

Please sign in to comment.