@cocreate/socket-server 1.21.7 → 1.21.8

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.21.8](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.7...v1.21.8) (2023-11-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * url bug ([5265962](https://github.com/CoCreate-app/CoCreate-socket-server/commit/526596254d9554de67dc78b296abe57765cb51fc))
7
+
1
8
  ## [1.21.7](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.21.6...v1.21.7) (2023-11-09)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/socket-server",
3
- "version": "1.21.7",
3
+ "version": "1.21.8",
4
4
  "description": "CoCreate-socket-server",
5
5
  "keywords": [
6
6
  "cocreate-socket",
package/src/index.js CHANGED
@@ -57,8 +57,10 @@ class SocketServer extends EventEmitter {
57
57
  socket.socketUrl = socket.origin + socket.pathname
58
58
 
59
59
  if (socket.origin && socket.origin !== 'null') {
60
- const url = new URL(socket.origin);
61
- socket.host = url.host || socket.origin;
60
+ if (socket.origin.includes('://'))
61
+ socket.host = new URL(socket.origin).host
62
+ else
63
+ socket.host = socket.origin;
62
64
  }
63
65
 
64
66
  if (!organization || organization && organization.status !== false) {