Socket
Socket
Sign inDemoInstall

ui5-middleware-http-proxy

Package Overview
Dependencies
74
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

package-lock.json

14

lib/middleware/http-proxy.js
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 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc