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

3
app/js/lib/config.js

@ -28,7 +28,8 @@ Config.App = { @@ -28,7 +28,8 @@ Config.App = {
Config.Modes = {
test: location.search.indexOf('test=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,
webcrypto: location.search.indexOf('webcrypto=0')== -1,
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']) @@ -4026,6 +4026,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
function start () {
if (started ||
location.protocol != 'http:' ||
Config.Modes.http ||
Config.App.domains.indexOf(location.hostname) == -1) {
return;
}

Loading…
Cancel
Save