From c5ba502ed5342c5d65c247b526f4e6c5b3f797ce Mon Sep 17 00:00:00 2001 From: Alexandr Balasyan Date: Wed, 14 Feb 2024 15:38:17 +0300 Subject: [PATCH] added client option request.ingoreVersion --- package.json | 2 +- src/client.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a78bcfd..c4cdea1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spreadable", - "version": "0.2.30", + "version": "0.2.31", "description": "Decentralized network mechanism", "bin": { "spreadable": "./bin/index.js" diff --git a/src/client.js b/src/client.js index c9d0cea..c64aa02 100644 --- a/src/client.js +++ b/src/client.js @@ -417,11 +417,14 @@ module.exports = (Parent) => { createDefaultRequestOptions(options = {}) { const defaults = { method: 'POST', - timeout: this.options.request.clientTimeout, - headers: { + timeout: this.options.request.clientTimeout + }; + + if(!this.options.request.ignoreVersion) { + defaults.headers = { 'client-version': this.getVersion() } - }; + } if(this.options.auth) { const username = this.options.auth.username;