From 31c367a3277d0315b81d826e2eac0c210d65beed Mon Sep 17 00:00:00 2001 From: Mikhail Yarmaliuk Date: Fri, 28 Aug 2020 18:46:27 +0300 Subject: [PATCH] Fix gateway merge config --- package.json | 2 +- src/Gateway.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ce94f3d..db13be5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kakadu-dev/nodejs-ijson-microservices", - "version": "1.3.0", + "version": "1.3.1", "description": "Package for create microservice architecture based on NodeJS. ", "keywords": [ "node", diff --git a/src/Gateway.js b/src/Gateway.js index 06252a9..b2f1a91 100644 --- a/src/Gateway.js +++ b/src/Gateway.js @@ -265,12 +265,13 @@ class Gateway ...req.body, method, }); - - return axios.post(`${this.options.ijson}/${name}`, new MjRequest(params), _.merge(this.options.requestParams, { + const config = _.merge({ ...this.options.requestParams }, { headers: { ...(req?.headers?.type ? { type: req.headers.type } : {}), }, - }, reqParams)); + }, reqParams); + + return axios.post(`${this.options.ijson}/${name}`, new MjRequest(params), config); } /**