From cfeb2797aa98b9c8d91e71e089c05f6d3f482dd9 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 2 Jan 2019 12:18:05 +0100 Subject: [PATCH] fixed invalid callback url --- shared/js/client.ts | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/shared/js/client.ts b/shared/js/client.ts index 18762454..6ce75e8d 100644 --- a/shared/js/client.ts +++ b/shared/js/client.ts @@ -142,34 +142,25 @@ class TSClient { } private certAcceptUrl() { - //TODO here const properties = { - connect_direct: true, + connect_default: true, connect_profile: this.serverConnection._handshakeHandler.profile.id, - connect_url: this.serverConnection._remote_address.host + ":" + this.serverConnection._remote_address.port + connect_address: this.serverConnection._remote_address.host + ":" + this.serverConnection._remote_address.port }; + + const parameters: string[] = []; + for(const key in properties) + parameters.push(encodeURIComponent(key) + "=" + encodeURIComponent(properties[key])); + + + // document.URL let callback = document.URL; if(document.location.search.length == 0) - callback += "?default_connect_url=true"; + callback += "?" + parameters.join("&"); else - callback += "&default_connect_url=true"; - // - - //this.serverConnection._handshakeHandler.profile - callback += "&connect_profile=" + encodeURIComponent(this.serverConnection._handshakeHandler.profile.id); - /* - switch (this.serverConnection._handshakeHandler.profile.type()) { - case IdentitifyType.TEAFORO: - callback += "&default_connect_type=teaforo"; - break; - case IdentitifyType.TEAMSPEAK: - callback += "&default_connect_type=teamspeak"; - break; - } - */ - callback += "&default_connect_url=" + encodeURIComponent(this.serverConnection._remote_address.host + ":" + this.serverConnection._remote_address.port); + callback += "&" + parameters.join("&"); return "https://" + this.serverConnection._remote_address.host + ":" + this.serverConnection._remote_address.port + "/?forward_url=" + encodeURIComponent(callback); }