Skip to content

Commit

Permalink
Merge tag '3.17.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 17, 2014
2 parents daacb74 + f29399c commit 916a75c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
22 changes: 22 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ unreleased
==========

* Fix `app.use` to accept array of middleware without path
* deps: depd@0.4.5
* deps: send@0.9.2
- deps: depd@0.4.5
- deps: etag@~1.3.1
- deps: range-parser@~1.0.2

4.9.0 / 2014-09-08
==================
Expand Down Expand Up @@ -471,6 +476,23 @@ unreleased
- `app.route()` - Proxy to the app's `Router#route()` method to create a new route
- Router & Route - public API

3.17.2 / 2014-09-15
===================

* Use `crc` instead of `buffer-crc32` for speed
* deps: connect@2.26.1
- deps: body-parser@~1.8.2
- deps: depd@0.4.5
- deps: express-session@~1.8.2
- deps: morgan@~1.3.1
- deps: serve-favicon@~2.1.3
- deps: serve-static@~1.6.2
* deps: depd@0.4.5
* deps: send@0.9.2
- deps: depd@0.4.5
- deps: etag@~1.3.1
- deps: range-parser@~1.0.2

3.17.1 / 2014-09-08
===================

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"accepts": "~1.1.0",
"cookie-signature": "1.0.5",
"debug": "~2.0.0",
"depd": "0.4.4",
"depd": "0.4.5",
"escape-html": "1.0.1",
"etag": "~1.3.0",
"finalhandler": "0.2.0",
Expand All @@ -43,7 +43,7 @@
"proxy-addr": "1.0.1",
"qs": "2.2.3",
"range-parser": "~1.0.2",
"send": "0.9.1",
"send": "0.9.2",
"serve-static": "~1.6.1",
"type-is": "~1.5.1",
"vary": "~1.0.0",
Expand Down Expand Up @@ -77,6 +77,7 @@
"prepublish": "npm prune",
"test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",
"test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/"
}
}
22 changes: 15 additions & 7 deletions test/req.ip.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ describe('req', function(){
res.send(req.ip);
});

request(app)
.get('/')
.set('X-Forwarded-For', 'client, p1, p2')
.expect('127.0.0.1', done);
var test = request(app).get('/')
test.set('X-Forwarded-For', 'client, p1, p2')
test.expect(200, getExpectedClientAddress(test._server), done);
})
})
})
Expand All @@ -63,10 +62,19 @@ describe('req', function(){
res.send(req.ip);
});

request(app)
.get('/')
.expect('127.0.0.1', done);
var test = request(app).get('/')
test.expect(200, getExpectedClientAddress(test._server), done);
})
})
})
})

/**
* Get the local client address depending on AF_NET of server
*/

function getExpectedClientAddress(server) {
return server.address().address === '::'
? '::ffff:127.0.0.1'
: '127.0.0.1';
}

0 comments on commit 916a75c

Please sign in to comment.