mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 17:22:20 +09:00
17100567 : Enable SSL always
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5126 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c6397a1f83
commit
602837f8c2
4 changed files with 42 additions and 13 deletions
|
|
@ -328,26 +328,36 @@ String.prototype.setQuery = function(key, val) {
|
|||
}
|
||||
uri = uri.replace(re,toReplace);
|
||||
}
|
||||
|
||||
if(typeof(ssl_actions)!='undefined' && typeof(ssl_actions.length)!='undefined' && uri.getQuery('act')) {
|
||||
var bUseSSL = false;
|
||||
if(typeof(enforce_ssl)!='undefined' && enforce_ssl)
|
||||
{
|
||||
bUseSSL = true;
|
||||
}
|
||||
else if(typeof(ssl_actions)!='undefined' && typeof(ssl_actions.length)!='undefined' && uri.getQuery('act')) {
|
||||
var act = uri.getQuery('act');
|
||||
for(i=0;i<ssl_actions.length;i++) {
|
||||
if(ssl_actions[i]==act) {
|
||||
var re = /http:\/\/([^:\/]+)(:\d+|)/i;
|
||||
var check = re.exec(uri);
|
||||
if(check)
|
||||
{
|
||||
var toReplace = "https://"+check[1];
|
||||
if(typeof(https_port)!='undefined' && https_port != 443)
|
||||
{
|
||||
toReplace += ":" + https_port;
|
||||
}
|
||||
uri = uri.replace(re,toReplace);
|
||||
}
|
||||
bUseSSL = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(bUseSSL)
|
||||
{
|
||||
var re = /http:\/\/([^:\/]+)(:\d+|)/i;
|
||||
var check = re.exec(uri);
|
||||
if(check)
|
||||
{
|
||||
var toReplace = "https://"+check[1];
|
||||
if(typeof(https_port)!='undefined' && https_port != 443)
|
||||
{
|
||||
toReplace += ":" + https_port;
|
||||
}
|
||||
uri = uri.replace(re,toReplace);
|
||||
}
|
||||
}
|
||||
|
||||
return encodeURI(uri);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue