From b929b8bcef2f25525e60268ee93198fecaf62495 Mon Sep 17 00:00:00 2001 From: Efe Barlas <43009963+efebarlas@users.noreply.github.com> Date: Thu, 7 Apr 2022 15:23:49 -0400 Subject: [PATCH] Update security.md -> ReDoS Attack Section I made a mistake with one of the code snippets in the documentation. The 'regExp' attribute belongs to the code options, not the ajv options directly. --- docs/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/security.md b/docs/security.md index f4818b5b0..7ecf8b031 100644 --- a/docs/security.md +++ b/docs/security.md @@ -72,7 +72,7 @@ To use a third-party regex engine in Ajv, set the ajv.opts.code.regExp property ``` const Ajv = require("ajv") const RE2 = require("re2") -const ajv = new Ajv({regExp: RE2}) +const ajv = new Ajv({code: {regExp: RE2}}) ``` For details about the interface of the `regexp` option, see options.md under the docs folder.