ws-process 0.3.31 → 0.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +12 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -457,6 +457,17 @@ function handleResponseHandler(res, getState, isLast = true, isFirst = true) {
|
|
|
457
457
|
return { cbData };
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
+
function stringifyParams(params) {
|
|
461
|
+
if (!params) {
|
|
462
|
+
return params;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return Object.keys(params).reduce((acc, key) => {
|
|
466
|
+
acc[key] = tryit(() => JSON.stringify(params[key]), params[key]);
|
|
467
|
+
return acc;
|
|
468
|
+
}, {});
|
|
469
|
+
}
|
|
470
|
+
|
|
460
471
|
function asyncSend(msg) {
|
|
461
472
|
return (dispatch, getState) => {
|
|
462
473
|
// eslint-disable-next-line consistent-return
|
|
@@ -531,7 +542,7 @@ function asyncSend(msg) {
|
|
|
531
542
|
const httpMSG = removeUndefinedKeys({
|
|
532
543
|
url,
|
|
533
544
|
method: msg.method,
|
|
534
|
-
params: defined(msg.params, msg.method === 'GET' ? msg.body : undefined),
|
|
545
|
+
params: defined(msg.params, msg.method === 'GET' ? stringifyParams(msg.body) : undefined),
|
|
535
546
|
data: defined(msg.data, msg.method !== 'GET' ? msg.body : undefined),
|
|
536
547
|
headers: {
|
|
537
548
|
...msg.headers,
|