From dc6252d3f6d35f4ce092d0bf920095f478dff847 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 20 Feb 2018 10:35:45 +0200 Subject: [PATCH] Consider localhost connections secure --- src/models/network.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/network.js b/src/models/network.js index 1348a8b1..5737ce24 100644 --- a/src/models/network.js +++ b/src/models/network.js @@ -111,8 +111,11 @@ Network.prototype.getNetworkStatus = function() { const transport = this.irc.connection.transport; if (transport.socket) { + const isLocalhost = transport.socket.remoteAddress === "127.0.0.1"; + const isAuthorized = transport.socket.encrypted && transport.socket.authorized; + status.connected = transport.isConnected(); - status.secure = (transport.socket.encrypted && transport.socket.authorized) || false; + status.secure = isAuthorized || isLocalhost; } }