http-proxy-middleware
Advanced tools
Comparing version 0.17.0 to 0.17.1
# Changelog | ||
## [v0.17.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.1) | ||
- fix(Express sub Router): 404 on non-proxy routes ([#94](https://github.com/chimurai/http-proxy-middleware/issues/94)) | ||
## [v0.17.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.0) | ||
@@ -4,0 +7,0 @@ - fix(context matching): Use [RFC 3986 path](https://tools.ietf.org/html/rfc3986#section-3.3) in context matching. (excludes query parameters) |
@@ -38,6 +38,3 @@ var _ = require('lodash'); | ||
function middleware(req, res, next) { | ||
// https://github.com/chimurai/http-proxy-middleware/issues/17 | ||
req.url = req.originalUrl; | ||
if (contextMatcher.match(config.context, req.url, req)) { | ||
if (shouldProxy(config.context, req)) { | ||
var activeProxyOptions = prepareProxyRequest(req); | ||
@@ -59,3 +56,3 @@ proxy.web(req, res, activeProxyOptions); | ||
function handleUpgrade(req, socket, head) { | ||
if (contextMatcher.match(config.context, req.url, req)) { | ||
if (shouldProxy(config.context, req)) { | ||
var activeProxyOptions = prepareProxyRequest(req); | ||
@@ -68,2 +65,13 @@ proxy.ws(req, socket, head, activeProxyOptions); | ||
/** | ||
* Determine whether request should be proxied. | ||
* | ||
* @private | ||
* @return {Boolean} | ||
*/ | ||
function shouldProxy(context, req) { | ||
var path = (req.originalUrl || req.url); | ||
return contextMatcher.match(context, path, req); | ||
} | ||
/** | ||
* Apply option.router and option.pathRewrite | ||
@@ -75,2 +83,6 @@ * Order matters: | ||
function prepareProxyRequest(req) { | ||
// https://github.com/chimurai/http-proxy-middleware/issues/17 | ||
// https://github.com/chimurai/http-proxy-middleware/issues/94 | ||
req.url = (req.originalUrl || req.url); | ||
// store uri before it gets rewritten for logging | ||
@@ -77,0 +89,0 @@ var originalPath = req.url; |
{ | ||
"name": "http-proxy-middleware", | ||
"version": "0.17.0", | ||
"version": "0.17.1", | ||
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync", | ||
@@ -38,20 +38,20 @@ "main": "index.js", | ||
"devDependencies": { | ||
"browser-sync": "^2.13.0", | ||
"browser-sync": "^2.14.0", | ||
"chai": "^3.5.0", | ||
"connect": "^3.4.1", | ||
"coveralls": "^2.11.9", | ||
"express": "^4.13.4", | ||
"istanbul": "^0.4.3", | ||
"coveralls": "^2.11.12", | ||
"express": "^4.14.0", | ||
"istanbul": "^0.4.4", | ||
"istanbul-coveralls": "^1.0.3", | ||
"mocha": "^2.5.3", | ||
"mocha": "^3.0.2", | ||
"mocha-lcov-reporter": "1.2.0", | ||
"opn": "^4.0.2", | ||
"ws": "^1.1.0" | ||
"ws": "^1.1.1" | ||
}, | ||
"dependencies": { | ||
"http-proxy": "^1.13.3", | ||
"http-proxy": "^1.14.0", | ||
"is-glob": "^2.0.1", | ||
"lodash": "^4.13.1", | ||
"micromatch": "^2.3.8" | ||
"lodash": "^4.14.2", | ||
"micromatch": "^2.3.11" | ||
} | ||
} |
@@ -6,2 +6,3 @@ # http-proxy-middleware | ||
[![dependency Status](https://img.shields.io/david/chimurai/http-proxy-middleware.svg?style=flat-square)](https://david-dm.org/chimurai/http-proxy-middleware#info=dependencies) | ||
[![dependency Status](https://snyk.io/test/npm/http-proxy-middleware/badge.svg)](https://snyk.io/test/npm/http-proxy-middleware) | ||
@@ -8,0 +9,0 @@ Node.js proxying made simple. Configure proxy middleware with ease for [connect](https://github.com/senchalabs/connect), [express](https://github.com/strongloop/express), [browser-sync](https://github.com/BrowserSync/browser-sync) and [many more](#compatible-servers). |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
258079
57
434
3
1101
Updatedhttp-proxy@^1.14.0
Updatedlodash@^4.14.2
Updatedmicromatch@^2.3.11