ws-process 0.3.25 → 0.3.26

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.
Files changed (2) hide show
  1. package/index.js +13 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -522,9 +522,21 @@ function asyncSend(msg) {
522
522
  }
523
523
  local.dispatch(updateWSCount(processID));
524
524
  reject(ex);
525
+ }).then((data) => {
526
+ const bodyUrl = tryit(() => data.data.getBodyFromUrl === true && data.data.url);
527
+ if (bodyUrl) {
528
+ return axios({
529
+ url: bodyUrl,
530
+ }).then((bodyData) => ({
531
+ ...data,
532
+ data: bodyData.data,
533
+ }));
534
+ }
535
+ return data;
525
536
  }).then((data) => {
526
537
  console.log('%cHTTP.res:', 'color:red', data);
527
- const { 'process-id': processID } = data.headers;
538
+ const processID = tryit(() => data.headers['process-id']) || tryit(() => data.config.headers['bsg-support-process-id']);
539
+
528
540
  const newData = {
529
541
  processID,
530
542
  body: data.data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws-process",
3
- "version": "0.3.25",
3
+ "version": "0.3.26",
4
4
  "description": "Process Management for Web Socket Client",
5
5
  "main": "index.js",
6
6
  "scripts": {