http-proxy-middleware
Advanced tools
Comparing version 0.16.0 to 0.17.0-beta
# Changelog | ||
## [develop](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.0) | ||
- fix(wildcard context matching): Use [RFC 3986 path](https://tools.ietf.org/html/rfc3986#section-3.3) in wildcard matching. (excludes query parameters) | ||
## [v0.16.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.16.0) | ||
@@ -4,0 +7,0 @@ - deprecated(proxyTable): renamed `proxyTable` to `router`. |
@@ -36,3 +36,3 @@ var _ = require('lodash'); | ||
if (_.isFunction(context)) { | ||
var path = getUrlPath(uri); | ||
var path = getUrl(uri).path; | ||
return context(path, req); | ||
@@ -50,3 +50,3 @@ } | ||
function matchSingleStringPath(context, uri) { | ||
var path = getUrlPath(uri); | ||
var path = getUrl(uri).path; | ||
return path.indexOf(context) === 0; | ||
@@ -56,4 +56,4 @@ } | ||
function matchSingleGlobPath(pattern, uri) { | ||
var path = getUrlPath(uri); | ||
var matches = micromatch(path, pattern); | ||
var pathname = getUrl(uri).pathname; | ||
var matches = micromatch(pathname, pattern); | ||
return matches && (matches.length > 0); | ||
@@ -81,4 +81,4 @@ } | ||
function getUrlPath(uri) { | ||
return uri && url.parse(uri).path; | ||
function getUrl(uri) { | ||
return uri && url.parse(uri); | ||
} | ||
@@ -85,0 +85,0 @@ |
{ | ||
"name": "http-proxy-middleware", | ||
"version": "0.16.0", | ||
"version": "0.17.0-beta", | ||
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -114,5 +114,5 @@ var expect = require('chai').expect; | ||
it('should only match .php files with query params', function() { | ||
expect(contextMatcher.match('/**/*.php', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.false; | ||
expect(contextMatcher.match('/**/*.php?*', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.true; | ||
it('should ignore query params', function() { | ||
expect(contextMatcher.match('/**/*.php', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.true; | ||
expect(contextMatcher.match('/**/*.php?*', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.false; | ||
}); | ||
@@ -119,0 +119,0 @@ |
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
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
159774