From 3aa82c3e8a21773ecc702c8396fb954cd6d19ef4 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 11 Sep 2014 09:29:11 -0700 Subject: [PATCH] settings: indexof fix --- js/models/blockchain/Insight.js | 2 +- js/models/network/Async.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/models/blockchain/Insight.js b/js/models/blockchain/Insight.js index e7da834fc..82d29e81d 100644 --- a/js/models/blockchain/Insight.js +++ b/js/models/blockchain/Insight.js @@ -39,7 +39,7 @@ var Insight = function(opts) { this.opts = { 'reconnection': opts.reconnection || true, 'reconnectionDelay': opts.reconnectionDelay || 1000, - 'secure': opts.url.indexOf('https') > -1 + 'secure': opts.url.indexOf('https') === 0 }; this.socket = this.getSocket(); diff --git a/js/models/network/Async.js b/js/models/network/Async.js index 695e8ae78..869591afe 100644 --- a/js/models/network/Async.js +++ b/js/models/network/Async.js @@ -326,7 +326,7 @@ Network.prototype.createSocket = function() { return io.connect(this.url, { reconnection: true, 'force new connection': true, - 'secure': this.url.indexOf('https') > -1, + 'secure': this.url.indexOf('https') === 0, }); };