Browse Source

Blocking issues workaround

Added force no-ssl version
Added no-redirect version
master
Igor Zhukov 10 years ago
parent
commit
5c66fe0ef1
  1. 3
      app/js/controllers.js
  2. 3
      app/js/lib/config.js
  3. 1
      app/js/services.js

3
app/js/controllers.js

@ -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 {

3
app/js/lib/config.js

@ -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:',

1
app/js/services.js

@ -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;
} }

Loading…
Cancel
Save