More lenient parameter checks (#1662)

This commit is contained in:
Tomas Della Vedova
2022-03-30 13:34:36 +02:00
committed by GitHub
parent eac00e1200
commit 96b5b8eaba

View File

@ -186,15 +186,15 @@ export default class Client extends API {
maxCompressedResponseSize: null
}, opts)
if (options.caFingerprint !== null && isHttpConnection(opts.node ?? opts.nodes)) {
if (options.caFingerprint != null && isHttpConnection(opts.node ?? opts.nodes)) {
throw new errors.ConfigurationError('You can\'t configure the caFingerprint with a http connection')
}
if (options.maxResponseSize !== null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) {
if (options.maxResponseSize != null && options.maxResponseSize > buffer.constants.MAX_STRING_LENGTH) {
throw new errors.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 errors.ConfigurationError(`The maxCompressedResponseSize cannot be bigger than ${buffer.constants.MAX_LENGTH}`)
}