Skip to content

Commit 7a3d980

Browse files
committed
human lint
1 parent d058b51 commit 7a3d980

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

gui/src/main/proxy.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ const config = require('yargs')
2323
.help('help')
2424
.parse()
2525

26-
log.warn({config}, 'argv')
26+
log.debug({config}, 'argv')
2727

28-
const printCertificate = (certif) => `Certificate(${certif.issuerName} ${certif.subjectName})`
28+
const formatCertificate = (certif) => `Certificate(${certif.issuerName} ${certif.subjectName})`
2929

3030
module.exports = (app, session, doneSetup) => {
3131
const loginByRealm = {}
3232
if (config['login-by-realm']) {
3333
config['login-by-realm'].split(',').forEach((lbr) => {
34-
const [realm, username, password] = lbr.split(':')
35-
loginByRealm[realm] = [username, password]
34+
const [realm, username, ...password] = lbr.split(':')
35+
loginByRealm[realm] = [username, password.join(':')]
3636
})
3737
}
3838

@@ -43,9 +43,9 @@ module.exports = (app, session, doneSetup) => {
4343
session.defaultSession.setCertificateVerifyProc((request, callback) => {
4444
const {hostname, certificate, verificationResult, errorCode} = request
4545
if (verificationResult < 0) {
46-
log.warn({hostname, certificate: printCertificate(certificate), verificationResult, errorCode}, 'Certificate Verification Error')
46+
log.warn({hostname, certificate: formatCertificate(certificate), verificationResult, errorCode}, 'Certificate Verification Error')
4747
} else {
48-
log.debug({hostname, certificate: printCertificate(certificate), verificationResult, errorCode}, 'Certificate Validated')
48+
log.debug({hostname, certificate: formatCertificate(certificate), verificationResult, errorCode}, 'Certificate Validated')
4949
}
5050
callback(-3) // use chrome validation
5151
})
@@ -56,12 +56,12 @@ module.exports = (app, session, doneSetup) => {
5656
})
5757

5858
app.on('certificate-error', (event, webContents, url, error, certificate, callback) => {
59-
log.warn({url, error, certificate: printCertificate(certificate)}, 'App Certificate Error')
59+
log.warn({url, error, certificate: formatCertificate(certificate)}, 'App Certificate Error')
6060
callback(false)
6161
})
6262

6363
app.on('login', (event, webContents, request, authInfo, callback) => {
64-
log.warn({request: request.method + ' ' + request.url, authInfo}, 'Login event')
64+
log.debug({request: request.method + ' ' + request.url, authInfo}, 'Login event')
6565
const auth = loginByRealm[authInfo.realm]
6666
if (auth) {
6767
event.preventDefault()

0 commit comments

Comments
 (0)