Blocking issues workaround

Added force no-ssl version
Added no-redirect version
This commit is contained in:
Igor Zhukov 2014-12-15 12:11:03 -08:00
parent 0a66601444
commit 5c66fe0ef1
3 changed files with 6 additions and 1 deletions

@ -18,6 +18,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
return; return;
} }
if (location.protocol == 'http:' && if (location.protocol == 'http:' &&
!Config.Modes.http &&
Config.App.domains.indexOf(location.hostname) != -1) { Config.App.domains.indexOf(location.hostname) != -1) {
location.protocol = 'https:'; location.protocol = 'https:';
return; return;
@ -40,6 +41,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
return; return;
} }
if (location.protocol == 'http:' && if (location.protocol == 'http:' &&
!Config.Modes.http &&
Config.App.domains.indexOf(location.hostname) != -1) { Config.App.domains.indexOf(location.hostname) != -1) {
location.protocol = 'https:'; location.protocol = 'https:';
} }
@ -633,6 +635,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
if (error.code == 401) { if (error.code == 401) {
MtpApiManager.logOut()['finally'](function () { MtpApiManager.logOut()['finally'](function () {
if (location.protocol == 'http:' && if (location.protocol == 'http:' &&
!Config.Modes.http &&
Config.App.domains.indexOf(location.hostname) != -1) { Config.App.domains.indexOf(location.hostname) != -1) {
location.protocol = 'https:'; location.protocol = 'https:';
} else { } else {

@ -28,7 +28,8 @@ Config.App = {
Config.Modes = { Config.Modes = {
test: location.search.indexOf('test=1') > 0, test: location.search.indexOf('test=1') > 0,
debug: location.search.indexOf('debug=1') > 0, debug: location.search.indexOf('debug=1') > 0,
ssl: location.search.indexOf('ssl=1') > 0 || location.protocol == 'https:', http: location.search.indexOf('http=1') > 0,
ssl: location.search.indexOf('ssl=1') > 0 || location.protocol == 'https:' && location.search.indexOf('ssl=0') == -1,
nacl: location.search.indexOf('nacl=0')== -1, nacl: location.search.indexOf('nacl=0')== -1,
webcrypto: location.search.indexOf('webcrypto=0')== -1, webcrypto: location.search.indexOf('webcrypto=0')== -1,
packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:', packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:',

@ -4026,6 +4026,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
function start () { function start () {
if (started || if (started ||
location.protocol != 'http:' || location.protocol != 'http:' ||
Config.Modes.http ||
Config.App.domains.indexOf(location.hostname) == -1) { Config.App.domains.indexOf(location.hostname) == -1) {
return; return;
} }