From 7f13a73bd302f6679212c16140f3bfd1e4ab1215 Mon Sep 17 00:00:00 2001 From: Tomas Della Vedova Date: Wed, 30 Mar 2022 13:34:46 +0200 Subject: [PATCH] More lenient parameter checks (v7) (#1663) --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d90aa1a1b..dee102ca0 100644 --- a/index.js +++ b/index.js @@ -120,15 +120,15 @@ class Client extends ESAPI { maxCompressedResponseSize: null }, opts) - if (options.maxResponseSize !== null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) { + if (options.maxResponseSize != null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) { throw new ConfigurationError(`The maxResponseSize cannot be bigger than ${buffer.constants.MAX_STRING_LENGTH}`) } - if (options.maxCompressedResponseSize !== null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) { + if (options.maxCompressedResponseSize != null && options.maxCompressedResponseSize > buffer.constants.MAX_LENGTH) { throw new ConfigurationError(`The maxCompressedResponseSize cannot be bigger than ${buffer.constants.MAX_LENGTH}`) } - if (options.caFingerprint !== null && isHttpConnection(opts.node || opts.nodes)) { + if (options.caFingerprint != null && isHttpConnection(opts.node || opts.nodes)) { throw new ConfigurationError('You can\'t configure the caFingerprint with a http connection') }