Fixed https redirect

This commit is contained in:
Igor Zhukov 2014-04-29 22:09:17 +08:00
parent 865f2b6824
commit 08b278069d
2 changed files with 3 additions and 3 deletions

View File

@ -158,7 +158,7 @@ angular.module('myApp.controllers', [])
case 'NETWORK_BAD_REQUEST':
if (location.protocol == 'https:') {
ErrorService.confirm({type: 'HTTPS_MIXED_FAIL'}).then(function () {
location = location.toString().replace('/^https:/', 'http:');
location = location.toString().replace(/^https:/, 'http:');
});
error.handled = true;
}
@ -386,7 +386,7 @@ angular.module('myApp.controllers', [])
if (error.type == 'NETWORK_BAD_REQUEST') {
if (location.protocol == 'https:') {
ErrorService.confirm({type: 'HTTPS_MIXED_FAIL'}).then(function () {
location = location.toString().replace('/^https:/', 'http:');
location = location.toString().replace(/^https:/, 'http:');
});
error.handled = true;
}

View File

@ -10,7 +10,7 @@
<span ng-switch-when="HISTORY_FLUSH">Are you sure? This can not be undone!</span>
<span ng-switch-when="TERMINATE_SESSIONS">Are you sure you want to log out all devices except for the current one?</span>
<span ng-switch-when="HTTPS_MIXED_FAIL">
Your browser does not support mixed content which is neccessary for MTProto support on https. <a href="https://github.com/zhukov/webogram/issues/237" target="_blank">Learn more &rarr;</a><br/>
Your browser does not support mixed content which is neccessary for MTProto support on https. <a href="https://github.com/zhukov/webogram/issues/237" target="_blank">Learn more &raquo;</a><br/><br/>
Would you like use http-version instead?
</span>