Browse Source

Added ssl option to config to force HTTPS

master
Igor Zhukov 10 years ago
parent
commit
4c58d00f74
  1. 1
      app/js/lib/config.js
  2. 4
      app/js/lib/mtproto.js

1
app/js/lib/config.js

@ -27,6 +27,7 @@ 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:',
packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:', packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:',
ios_standalone: window.navigator.standalone && navigator.userAgent.match(/iOS|iPhone|iPad/), ios_standalone: window.navigator.standalone && navigator.userAgent.match(/iOS|iPhone|iPad/),
chrome_packed: window.chrome && chrome.app && chrome.app.window && true || false chrome_packed: window.chrome && chrome.app && chrome.app.window && true || false

4
app/js/lib/mtproto.js

@ -9,7 +9,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
.factory('MtpDcConfigurator', function () { .factory('MtpDcConfigurator', function () {
var dcOptions = Config.Modes.test var dcOptions = Config.Modes.test
? (location.protocol == 'https:' ? (Config.Modes.ssl
? [ ? [
{id: 1, url: 'https://pluto.web.telegram.org/apiw_test1'}, {id: 1, url: 'https://pluto.web.telegram.org/apiw_test1'},
{id: 2, url: 'https://venus.web.telegram.org/apiw_test1'}, {id: 2, url: 'https://venus.web.telegram.org/apiw_test1'},
@ -20,7 +20,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
{id: 2, url: 'http://149.154.167.40/apiw1'}, {id: 2, url: 'http://149.154.167.40/apiw1'},
{id: 3, url: 'http://174.140.142.5/apiw1'} {id: 3, url: 'http://174.140.142.5/apiw1'}
]) ])
: (location.protocol == 'https:' : (Config.Modes.ssl
? [ ? [
{id: 1, url: 'https://pluto.web.telegram.org/apiw1'}, {id: 1, url: 'https://pluto.web.telegram.org/apiw1'},
{id: 2, url: 'https://venus.web.telegram.org/apiw1'}, {id: 2, url: 'https://venus.web.telegram.org/apiw1'},

Loading…
Cancel
Save