From 2f583f0907e11f00301ec6f73b26615544258b8c Mon Sep 17 00:00:00 2001 From: Narayana Shanbhog Date: Fri, 7 Jul 2023 15:39:34 +0530 Subject: [PATCH] remove body from get request (#306) * remove body * handle voice request * remove typo * update version --- CHANGELOG.md | 3 +++ lib/rest/axios.js | 4 +++- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80108e8b..693fa9a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log +## [v4.51.0](https://github.com/plivo/plivo-go/tree/v4.51.0) (2023-07-07) +**Fix Intermediate GET request failure** +- GET API request body removed ## [v4.50.0](https://github.com/plivo/plivo-go/tree/v4.50.0) (2023-06-28) **Feature - Audio Streaming** diff --git a/lib/rest/axios.js b/lib/rest/axios.js index d4c559c4..04b0eea5 100644 --- a/lib/rest/axios.js +++ b/lib/rest/axios.js @@ -165,9 +165,10 @@ export function Axios(config) { } } - if (method === 'GET' && options.data !== '') { + if (method === 'GET' && options.data !== '' && (!isVoiceReq)) { let query = '?' + queryString.stringify(params); options.url += query; + delete options.data } if (typeof config.proxy !== 'undefined') { @@ -188,6 +189,7 @@ export function Axios(config) { if (method === 'GET' && options.data !== '') { let query = '?' + queryString.stringify(params); options.url += query; + delete options.data } axios(options).then(response => { const exceptionClass = { diff --git a/package.json b/package.json index c1c12047..d316b602 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plivo", - "version": "4.50.0", + "version": "4.51.0", "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": [