From 764c78ac1f83fba4c736cb5e418d0feeabcaf0f4 Mon Sep 17 00:00:00 2001 From: patelravi Date: Thu, 11 Apr 2019 14:43:35 +0530 Subject: [PATCH 1/4] Added logic to add http response status in --- lib/rest/request.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/rest/request.js b/lib/rest/request.js index 30b59686..51f4227e 100644 --- a/lib/rest/request.js +++ b/lib/rest/request.js @@ -59,6 +59,10 @@ export function Request(config) { } } else { let body = response.body; + let isObj = typeof _body === 'object' && _body !== null && !(_body instanceof Array) && !(_body instanceof Date) + if (isObj) { + _body['statusCode'] = response.statusCode; + } resolve({ response: response, body: body }); } }); From b8b199cc0c23e3d0a98258018b67b14993ecb570 Mon Sep 17 00:00:00 2001 From: Deblina Date: Tue, 30 Jul 2019 17:39:10 +0530 Subject: [PATCH 2/4] added proxy support --- lib/utils/security.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils/security.js b/lib/utils/security.js index f5a6950b..3990ecf8 100644 --- a/lib/utils/security.js +++ b/lib/utils/security.js @@ -23,7 +23,8 @@ export function validateSignature(uri: string, nonce: string, signature: string, uri = utf8.encode(uri); let parsed_uri = parser.parse(uri); let url_protocol = parsed_uri.protocol == '' ? 'http://' : parsed_uri.protocol+'://'; - let base_url = buildUrl(url_protocol+parsed_uri.host, { path: parsed_uri.path }); + let proxy = parsed_uri.port == '' ? parsed_uri.host : parsed_uri.host + ':' + parsed_uri.port; + let base_url = buildUrl(url_protocol + proxy , { path: parsed_uri.path }); let hmac = crypto.createHmac('sha256', auth_token); let hmacBytes = base64.decode(hmac.update(base_url+nonce).digest('base64')); let authentication_string = base64.encode(hmacBytes); From 52795c24110184f666e01dd3be0baed542a2722c Mon Sep 17 00:00:00 2001 From: Deblina Date: Tue, 30 Jul 2019 17:58:45 +0530 Subject: [PATCH 3/4] bump version to 4.1.3 --- CHANGELOG.md | 8 ++++++-- package.json | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f887db..7573d86f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ # Change Log -## [4.1.2](https://github.com/plivo/plivo-node/releases/tag/v4.1.0)(2019-03-11) +## [4.1.3](https://github.com/plivo/plivo-node/releases/tag/v4.1.3)(2019-07-30) +- Add proxy-support for Signature Validation +- Add HTTP status codes in responses + +## [4.1.2](https://github.com/plivo/plivo-node/releases/tag/v4.1.2)(2019-03-19) - Add support: Handling circular reference stringify logic -## [4.1.1](https://github.com/plivo/plivo-node/releases/tag/v4.1.0)(2019-03-11) +## [4.1.1](https://github.com/plivo/plivo-node/releases/tag/v4.1.1)(2019-03-11) - Add PHLO support - Add Multiparty call triggers diff --git a/package.json b/package.json index 4ed69cc6..5d5c8c5e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "plivo", - "version": "4.1.2", - "description": "A Node.js SDK to make voice calls & send SMS using Plivo and to generate Plivo XML", + "version": "4.1.3", + "description": "A Node.js SDK to make voice calls and send SMS using Plivo and to generate Plivo XML", "homepage": "https://github.com/plivo/plivo-node", "files": [ "dist" From f0fd1125069b125ce87234a30d987ea9e37c88f5 Mon Sep 17 00:00:00 2001 From: Nixon Samuel Date: Tue, 30 Jul 2019 18:47:43 +0530 Subject: [PATCH 4/4] removed node 12 from travis yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a40bb382..cbc9852b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ service_name: travis-ci language: node_js node_js: - - "node" + # - "node" commenting this as we have to find out a solution for node12 & gulp3 - "lts/*" - "8" - "7"