http-proxy-middleware
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "http-proxy-middleware", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "The one-liner proxy middleware for connect, express and browser-sync", | ||
@@ -45,5 +45,5 @@ "main": "index.js", | ||
"is-glob": "^2.0.0", | ||
"micromatch": "~2.1.6", | ||
"micromatch": "^2.2.0", | ||
"url": "^0.10.3" | ||
} | ||
} |
@@ -117,5 +117,5 @@ # http-proxy-middleware | ||
* `**` matches any path, all requests will be proxied. | ||
* `**.html` matches any path which ends with `.html` | ||
* `**/*.html` matches any path which ends with `.html` | ||
* `/*.html` matches paths directly under path-absolute | ||
* `/api/**.html` matches requests ending with `.html` in the path of `/api` | ||
* `/api/**/*.html` matches requests ending with `.html` in the path of `/api` | ||
* `['/api/**', '/ajax/**']` combine multiple patterns | ||
@@ -122,0 +122,0 @@ * `['/api/**', '!**/bad.json']` exclusion |
@@ -85,6 +85,7 @@ var expect = require('chai').expect; | ||
expect(contextMatcher.match('**', url)).to.be.true; | ||
expect(contextMatcher.match('**/*', url)).to.be.true; | ||
expect(contextMatcher.match('**/*.*', url)).to.be.true; | ||
expect(contextMatcher.match('/**', url)).to.be.true; | ||
expect(contextMatcher.match('**.*', url)).to.be.true; | ||
expect(contextMatcher.match('/**.*', url)).to.be.true; | ||
expect(contextMatcher.match('**/*.*', url)).to.be.true; | ||
expect(contextMatcher.match('/**/*', url)).to.be.true; | ||
expect(contextMatcher.match('/**/*.*', url)).to.be.true; | ||
@@ -94,5 +95,7 @@ }); | ||
it('should only match .html files', function () { | ||
expect(contextMatcher.match('**.html', url)).to.be.true; | ||
expect(contextMatcher.match('**.htm', url)).to.be.false; | ||
expect(contextMatcher.match('**.jpg', url)).to.be.false; | ||
expect(contextMatcher.match('**/*.html', url)).to.be.true; | ||
expect(contextMatcher.match('/**.html', url)).to.be.true; | ||
expect(contextMatcher.match('/**/*.html', url)).to.be.true; | ||
expect(contextMatcher.match('/**.htm', url)).to.be.false; | ||
expect(contextMatcher.match('/**.jpg', url)).to.be.false; | ||
}); | ||
@@ -107,4 +110,4 @@ | ||
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; | ||
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; | ||
}); | ||
@@ -140,3 +143,3 @@ | ||
it('should return true when both file extensions pattern match', function () { | ||
var pattern = ['**.html','**.jpeg']; | ||
var pattern = ['/**.html','/**.jpeg']; | ||
expect(contextMatcher.match(pattern, 'http://localhost/api/foo/bar.html')).to.be.true; | ||
@@ -151,4 +154,4 @@ expect(contextMatcher.match(pattern, 'http://localhost/api/foo/bar.jpeg')).to.be.true; | ||
var url = 'http://localhost/api/foo/bar.html'; | ||
expect(contextMatcher.match(['**', '!**.html'], url)).to.be.false; | ||
expect(contextMatcher.match(['**', '!**.json'], url)).to.be.true; | ||
expect(contextMatcher.match(['**', '!**/*.html'], url)).to.be.false; | ||
expect(contextMatcher.match(['**', '!**/*.json'], url)).to.be.true; | ||
}); | ||
@@ -155,0 +158,0 @@ }); |
@@ -208,3 +208,3 @@ var expect = require('chai').expect; | ||
beforeEach(function () { | ||
var mw_proxy = proxyMiddleware(['**.html', '!**.json'], {target:'http://localhost:8000'}); | ||
var mw_proxy = proxyMiddleware(['/**.html', '!**.json'], {target:'http://localhost:8000'}); | ||
@@ -211,0 +211,0 @@ var mw_target = function (req, res, next) { |
45036
796
+ Addedarr-diff@2.0.0(transitive)
+ Addedarray-unique@0.2.1(transitive)
+ Addedextglob@0.3.2(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedmicromatch@2.3.11(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
- Removedarr-diff@1.1.0(transitive)
- Removedarray-slice@0.2.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removedis-glob@1.1.3(transitive)
- Removedisobject@0.2.0(transitive)
- Removedkind-of@1.1.0(transitive)
- Removedmicromatch@2.1.6(transitive)
- Removedms@2.0.0(transitive)
- Removedobject.omit@0.2.1(transitive)
Updatedmicromatch@^2.2.0