fixed invalid callback url
This commit is contained in:
parent
a04b6a2a21
commit
cfeb2797aa
1 changed files with 11 additions and 20 deletions
|
@ -142,34 +142,25 @@ class TSClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
private certAcceptUrl() {
|
private certAcceptUrl() {
|
||||||
//TODO here
|
|
||||||
const properties = {
|
const properties = {
|
||||||
connect_direct: true,
|
connect_default: true,
|
||||||
connect_profile: this.serverConnection._handshakeHandler.profile.id,
|
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
|
// document.URL
|
||||||
let callback = document.URL;
|
let callback = document.URL;
|
||||||
if(document.location.search.length == 0)
|
if(document.location.search.length == 0)
|
||||||
callback += "?default_connect_url=true";
|
callback += "?" + parameters.join("&");
|
||||||
else
|
else
|
||||||
callback += "&default_connect_url=true";
|
callback += "&" + parameters.join("&");
|
||||||
//
|
|
||||||
|
|
||||||
//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);
|
|
||||||
|
|
||||||
return "https://" + this.serverConnection._remote_address.host + ":" + this.serverConnection._remote_address.port + "/?forward_url=" + encodeURIComponent(callback);
|
return "https://" + this.serverConnection._remote_address.host + ":" + this.serverConnection._remote_address.port + "/?forward_url=" + encodeURIComponent(callback);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue