Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
2 changes: 1 addition & 1 deletion test/e2e/http-proxy-middleware.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions test/unit/context-matcher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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
Expand Down