ws-process 0.3.46 → 0.3.48

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 +10 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -89,8 +89,14 @@ function getWebSocket() {
89
89
  close()하면 onmessage 이벤트핸들러가 실행중에 중단되어
90
90
  프로그램이 정상적으로 동작하지 않는다.
91
91
  */
92
- if (isPreviewMode() && !existWS.url.endsWith('/dev')) {
93
- //
92
+ if (
93
+ (isPreviewMode() && !existWS.url.endsWith('/dev')) // preview mode
94
+ || (
95
+ !isPreviewMode()
96
+ && existWS.url.endsWith('/dev')
97
+ && window.location.hostname !== 'localhost'
98
+ ) // not preview mode
99
+ ) {
94
100
  if (existWS.readyState === existWS.OPEN) {
95
101
  // existWS.close();
96
102
  local.dispatch(removeWSInstance(existWS, true));
@@ -639,6 +645,7 @@ function asyncSend(msg) {
639
645
  headers['x-api-key'] = [user.systemID, user.partnerID].join('@');
640
646
  headers['request-datetime'] = cProcessItemRoot.requestTime;
641
647
  headers.href = window.location.href;
648
+ headers.origin = window.location.origin;
642
649
 
643
650
  const httpMSG = removeUndefinedKeys({
644
651
  url,
@@ -776,6 +783,7 @@ function asyncSend(msg) {
776
783
  jsonMSG.headers.requestTimestamp = cProcessItemRoot.requestTime;
777
784
  jsonMSG.headers['request-datetime'] = cProcessItemRoot.requestTime;
778
785
  jsonMSG.headers.href = window.location.href;
786
+ jsonMSG.headers.origin = window.location.origin;
779
787
 
780
788
  if (jsonMSG.action === 'requestodata') {
781
789
  jsonMSG.headers.authorization = `Basic ${btoa(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws-process",
3
- "version": "0.3.46",
3
+ "version": "0.3.48",
4
4
  "description": "Process Management for Web Socket Client",
5
5
  "main": "index.js",
6
6
  "scripts": {