diff --git a/.travis.yml b/.travis.yml index cae0fa01..d621260d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,6 @@ node_js: - '6' - '5' - '4' -- '0.12' -- '0.11' -- '0.10' before_install: # https://github.com/npm/npm/issues/11283 - npm set progress=false diff --git a/README.md b/README.md index 40787b54..0d800c55 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ var app = express(); Providing an alternative way to decide which requests should be proxied; In case you are not able to use the server's [`path` parameter](http://expressjs.com/en/4x/api.html#app.use) to mount the proxy or when you need more flexibility. -The [RFC 3986 `path`](https://tools.ietf.org/html/rfc3986#section-3.3) is be used for context matching. +[RFC 3986 `path`](https://tools.ietf.org/html/rfc3986#section-3.3) is used for context matching. ``` foo://example.com:8042/over/there?name=ferret#nose diff --git a/package.json b/package.json index f1ee3b26..50c53f8b 100644 --- a/package.json +++ b/package.json @@ -41,25 +41,30 @@ "homepage": "https://github.com/chimurai/http-proxy-middleware", "devDependencies": { "browser-sync": "^2.18.2", - "chai": "^3.5.0", + "chai": "^4.1.2", "connect": "^3.5.0", - "coveralls": "^2.11.15", + "coveralls": "^3.0.0", "express": "^4.14.0", "istanbul": "^0.4.5", "istanbul-coveralls": "^1.0.3", - "mocha": "^3.2.0", - "mocha-lcov-reporter": "1.2.0", - "opn": "^4.0.2", + "mocha": "^4.0.1", + "mocha-lcov-reporter": "1.3.0", + "opn": "^5.1.0", "standard": "^10.0.2", - "ws": "^1.1.1" + "ws": "^3.2.0" }, "dependencies": { "http-proxy": "^1.16.2", - "is-glob": "^3.1.0", + "is-glob": "^4.0.0", "lodash": "^4.17.2", - "micromatch": "^2.3.11" + "micromatch": "^3.1.0" + }, + "engines": { + "node" : ">=4.0.0" }, "standard": { - "env": [ "mocha" ] + "env": [ + "mocha" + ] } } diff --git a/test/e2e/http-proxy-middleware.spec.js b/test/e2e/http-proxy-middleware.spec.js index 3285e820..96b0e1f5 100644 --- a/test/e2e/http-proxy-middleware.spec.js +++ b/test/e2e/http-proxy-middleware.spec.js @@ -258,7 +258,7 @@ describe('E2E http-proxy-middleware', function () { var responseB beforeEach(function () { - var mwProxy = proxyMiddleware(['/**.html', '!**.json'], {target: 'http://localhost:8000'}) + var mwProxy = proxyMiddleware(['**/*.html', '!**.json'], {target: 'http://localhost:8000'}) var mwTarget = function (req, res, next) { res.write(req.url) // respond with req.url diff --git a/test/unit/context-matcher.spec.js b/test/unit/context-matcher.spec.js index 3986c8a7..bb18d9ae 100644 --- a/test/unit/context-matcher.spec.js +++ b/test/unit/context-matcher.spec.js @@ -94,17 +94,15 @@ describe('Context Matching', function () { 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 }) it('should only match .html files', function () { 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 + expect(contextMatcher.match('/*.htm', url)).to.be.false + expect(contextMatcher.match('/*.jpg', url)).to.be.false }) it('should only match .html under root path', function () { @@ -149,7 +147,7 @@ describe('Context Matching', function () { expect(contextMatcher.match(pattern, 'http://localhost/rest/foo/bar.json')).to.be.false }) 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 expect(contextMatcher.match(pattern, 'http://localhost/api/foo/bar.jpeg')).to.be.true expect(contextMatcher.match(pattern, 'http://localhost/api/foo/bar.gif')).to.be.false