Merge pull request #2081 from thelounge/xpaw/secure-localhost

Consider localhost connections secure
This commit is contained in:
Pavel Djundik 2018-02-21 14:00:56 +02:00 committed by GitHub
commit dfba84d811
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}