From 55fa0cd4ee5f4ffc763c7e9dfb8c4a8c6767a76b Mon Sep 17 00:00:00 2001 From: Ida Liu <119438987+ida613@users.noreply.github.com> Date: Tue, 13 Feb 2024 12:54:27 -0500 Subject: [PATCH] don't require appsec and iast when disabling them, if they haven't already been required --- packages/dd-trace/src/proxy.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/dd-trace/src/proxy.js b/packages/dd-trace/src/proxy.js index 3228145a67d..5a0f09f7ab0 100644 --- a/packages/dd-trace/src/proxy.js +++ b/packages/dd-trace/src/proxy.js @@ -118,8 +118,10 @@ class Tracer extends NoopProxy { require('./appsec/iast').enable(config, this._tracer) } } else { - require('./appsec').disable() - require('./appsec/iast').disable() + if (this._tracingInitialized) { + require('./appsec').disable() + require('./appsec/iast').disable() + } } if (this._tracingInitialized) { this._tracer.configure(config)