http-proxy-middleware
Advanced tools
Comparing version 0.17.1 to 0.17.2-beta
@@ -131,7 +131,8 @@ var _ = require('lodash'); | ||
function logError(err, req, res) { | ||
var hostname = (req.hostname || req.host) || (req.headers && req.headers.host); // (node0.10 || node 4/5) || (websocket) | ||
var targetUri = (proxyOptions.target.host || proxyOptions.target) + req.url; | ||
var hostname = (req.headers && req.headers.host) || (req.hostname || req.host); // (websocket) || (node0.10 || node 4/5) | ||
var target = proxyOptions.target.host || proxyOptions.target; | ||
var errReference = 'https://nodejs.org/api/errors.html#errors_common_system_errors'; // link to Node Common Systems Errors page | ||
logger.error('[HPM] PROXY ERROR: %s. %s -> %s', err.code, hostname, targetUri); | ||
logger.error('[HPM] Error occurred while trying to proxy request %s from %s to %s (%s) (%s)', req.url, hostname, target, err.code, errReference); | ||
} | ||
}; |
@@ -146,5 +146,5 @@ var util = require('util'); | ||
* -> normal proxy | ||
* => proxyTable | ||
* => router | ||
* ~> pathRewrite | ||
* ≈> proxyTable + pathRewrite | ||
* ≈> router + pathRewrite | ||
*/ | ||
@@ -151,0 +151,0 @@ function getArrow(originalPath, newPath, originalTarget, newTarget) { |
{ | ||
"name": "http-proxy-middleware", | ||
"version": "0.17.1", | ||
"version": "0.17.2-beta", | ||
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js", | ||
"lib" | ||
], | ||
"scripts": { | ||
@@ -7,0 +11,0 @@ "clean": "rm -rf coverage", |
@@ -113,3 +113,3 @@ # http-proxy-middleware | ||
}, | ||
proxyTable: { | ||
router: { | ||
// when request.headers.host == 'dev.localhost:3000', | ||
@@ -116,0 +116,0 @@ // override target 'http://www.example.org' to 'http://localhost:8000' |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
1
42824
12
578