larasopp 1.2.7 → 1.2.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/lib/Core.js +2 -4
- package/package.json +1 -1
- package/src/Core.ts +2 -4
package/lib/Core.js
CHANGED
|
@@ -55,10 +55,8 @@ class Core {
|
|
|
55
55
|
*/
|
|
56
56
|
connect(token) {
|
|
57
57
|
try {
|
|
58
|
-
const host =
|
|
59
|
-
|
|
60
|
-
host.push('/token=' + (token !== null && token !== void 0 ? token : this.config.token));
|
|
61
|
-
this.ws = new WebSocket(host.join(''));
|
|
58
|
+
const host = this.config.host + '/token=' + (token !== null && token !== void 0 ? token : this.config.token);
|
|
59
|
+
this.ws = new WebSocket(encodeURI(host));
|
|
62
60
|
this.ws.onopen = this.handleOpen;
|
|
63
61
|
this.ws.onclose = this.handleClose;
|
|
64
62
|
this.ws.onerror = this.handleError;
|
package/package.json
CHANGED
package/src/Core.ts
CHANGED
|
@@ -79,10 +79,8 @@ abstract class Core {
|
|
|
79
79
|
*/
|
|
80
80
|
public connect(token?: string): this {
|
|
81
81
|
try {
|
|
82
|
-
const host =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.ws = new WebSocket(host.join(''));
|
|
82
|
+
const host = this.config.host + '/token=' + (token ?? this.config.token);
|
|
83
|
+
this.ws = new WebSocket(encodeURI(host));
|
|
86
84
|
this.ws.onopen = this.handleOpen;
|
|
87
85
|
this.ws.onclose = this.handleClose;
|
|
88
86
|
this.ws.onerror = this.handleError;
|