Comparing version 1.5.0 to 1.6.0
@@ -17,2 +17,12 @@ module.exports = build | ||
}) | ||
.option('username', { | ||
type: 'string', | ||
desc: 'basic auth username', | ||
alias: ['u'] | ||
}) | ||
.option('password', { | ||
type: 'string', | ||
desc: 'basic auth password', | ||
alias: ['p'] | ||
}) | ||
.option('allow-invalid-certs', { | ||
@@ -19,0 +29,0 @@ type: 'boolean', |
@@ -20,3 +20,11 @@ module.exports = { | ||
function query ({method, timeout, url, header = [], allowInvalidCerts}) { | ||
function query ({ | ||
method, | ||
timeout, | ||
url, | ||
username, | ||
password, | ||
allowInvalidCerts, | ||
header = [] | ||
}) { | ||
let httpsAgent = undefined | ||
@@ -28,2 +36,4 @@ if (allowInvalidCerts) { | ||
let auth = (username || password) ? {username, password} : undefined | ||
const { | ||
@@ -53,2 +63,3 @@ blue, green, orange, purple, red, yellow | ||
httpsAgent, | ||
auth, | ||
validateStatus: status => true | ||
@@ -55,0 +66,0 @@ } |
{ | ||
"name": "aqui", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "Simple CLI HTTP client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
6920
187