server: lint

This commit is contained in:
bordun 2020-05-05 12:11:11 +02:00
parent a560313619
commit f0bb17193d
2 changed files with 12 additions and 13 deletions

View file

@ -17,8 +17,8 @@ class Ipc extends EventEmitter {
this.server.on('connection', (socket, req)=>{
if (settings.read('authentication')) {
if (!req.headers.authorization) return;
if (req.headers.authorization.search('Basic ') !== 0) return;
if (!req.headers.authorization) return
if (req.headers.authorization.search('Basic ') !== 0) return
var auth = new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString()
if (settings.read('authentication') !== auth) {
console.log(`(WARNING) Client connexion refused for ${req.connection.remoteAddress} (authentication failed)`)