ws-process 0.3.40 → 0.3.42

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 +4 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -84,7 +84,8 @@ function getWebSocket() {
84
84
  console.error('URL of WebSocket is undefined');
85
85
  return reject(new Error('URL of WebSocket is undefined'));
86
86
  }
87
- const wSocket = new WebSocket(local.wsURL);
87
+ const newWsUrl = window.location.pathname.startsWith('/lc-ui5/preview/') ? local.wsURL.replace(/\/(prod){1}$/, '/dev') : local.wsURL;
88
+ const wSocket = new WebSocket(newWsUrl);
88
89
 
89
90
  wSocket.onopen = (event) => {
90
91
  console.debug('web socket event onopen: ', event);
@@ -599,7 +600,7 @@ function asyncSend(msg) {
599
600
  const headers = {};
600
601
  headers['bsg-support-process-id'] = msg.processID;
601
602
  headers['bsg-support-api-key'] = user.apiKey || undefined;
602
- headers['bsg-support-stage'] = local.stage;
603
+ headers['bsg-support-stage'] = window.location.pathname.startsWith('/lc-ui5/preview/') ? 'dev' : local.stage;
603
604
  headers['bsg-support-token'] = user.token;
604
605
  headers['bsg-support-session'] = user.session;
605
606
  headers['bsg-support-user-id'] = user.id;
@@ -756,9 +757,7 @@ function asyncSend(msg) {
756
757
  }
757
758
  }
758
759
 
759
- if (['requestodata', 'requestsoap'].includes(jsonMSG.action)) {
760
- jsonMSG.compressAsGzip = true;
761
- }
760
+ jsonMSG.compressAsGzip = true;
762
761
 
763
762
  console.log('%csending message:', 'color:green', jsonMSG);
764
763
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws-process",
3
- "version": "0.3.40",
3
+ "version": "0.3.42",
4
4
  "description": "Process Management for Web Socket Client",
5
5
  "main": "index.js",
6
6
  "scripts": {