Skip to content

Commit

Permalink
Fix gateway merge config
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Aug 28, 2020
1 parent 14b6756 commit 31c367a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 4 additions & 3 deletions src/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 31c367a

Please sign in to comment.