ui5-middleware-http-proxy
Advanced tools
Comparing version 1.1.0 to 1.1.1
const log = require('@ui5/logger').getLogger('ui5-middleware-http-proxy') | ||
const request = require('request') | ||
const dotenv = require('dotenv') | ||
const lodash = require('lodash') | ||
@@ -8,10 +9,11 @@ // load .env | ||
const _setAuthEnvironment = auth => { | ||
const _getAuth = ({ auth = {} }) => { | ||
const { HTTP_PROXY_AUTH_USER, HTTP_PROXY_AUTH_PASS } = process.env | ||
if (!auth.user) { | ||
if (!auth.user && HTTP_PROXY_AUTH_USER) { | ||
auth.user = HTTP_PROXY_AUTH_USER | ||
} | ||
if (!auth.pass) { | ||
if (!auth.pass && HTTP_PROXY_AUTH_PASS) { | ||
auth.pass = HTTP_PROXY_AUTH_PASS | ||
} | ||
return !lodash.isEmpty(auth) ? auth : null | ||
} | ||
@@ -46,6 +48,6 @@ | ||
module.exports = ({ options: { configuration = {} } }) => { | ||
const { debug = false, baseUrl, path = '/', secure = true, auth = {} } = configuration | ||
const { debug = false, baseUrl, path = '/', secure = true } = configuration | ||
// try to set auth from .env | ||
_setAuthEnvironment(auth) | ||
// get http basic auth if any | ||
const auth = _getAuth(configuration) | ||
@@ -52,0 +54,0 @@ // baseUrl is mandatory |
{ | ||
"name": "ui5-middleware-http-proxy", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "custom ui5 middleware extension for proxying http requests", | ||
@@ -22,2 +22,3 @@ "keywords": [ | ||
"dotenv": "^8.2.0", | ||
"lodash": "^4.17.20", | ||
"request": "^2.88.0" | ||
@@ -24,0 +25,0 @@ }, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
190251
9
5084
4
1
+ Addedlodash@^4.17.20
+ Addedlodash@4.17.21(transitive)