Consider localhost connections secure

This commit is contained in:
Pavel Djundik 2018-02-20 10:35:45 +02:00
parent 1ce2792fc4
commit dc6252d3f6

View File

@ -111,8 +111,11 @@ Network.prototype.getNetworkStatus = function() {
const transport = this.irc.connection.transport; const transport = this.irc.connection.transport;
if (transport.socket) { 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.connected = transport.isConnected();
status.secure = (transport.socket.encrypted && transport.socket.authorized) || false; status.secure = isAuthorized || isLocalhost;
} }
} }