Browse Source

Fixed https redirect

master
Igor Zhukov 11 years ago
parent
commit
08b278069d
  1. 4
      app/js/controllers.js
  2. 2
      app/partials/confirm_modal.html

4
app/js/controllers.js

@ -158,7 +158,7 @@ angular.module('myApp.controllers', []) @@ -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', []) @@ -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;
}

2
app/partials/confirm_modal.html

@ -10,7 +10,7 @@ @@ -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>

Loading…
Cancel
Save