Merge tag '3.17.2'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Douglas Christopher Wilson · committed by Douglas Christopher Wilson · parents daacb74, f29399c · Browse files · 3 files·+40 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+40 added−9 removed
- tests:+15 added−7 removed
- other:+25 added−2 removed
Provenance
- Commit
916a75c- Tree
0aa3711- Author
Douglas Christopher Wilson <doug@somethingdoug.com>- Committer
Douglas Christopher Wilson <doug@somethingdoug.com>- Parent 1
daacb74- Parent 2
f29399c
3 files changed+40 added−9 removed
modified:test/req.ip.js+15 added-7 removed
43 unmodified lines4445464748495051484950515253546 unmodified lines616263646667686566676869707172737475767778798043 unmodified lines app.use(function(req, res, next){ 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); }) }) })
6 unmodified lines app.use(function(req, res, next){ 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';}modified:History.md+22 added
1 unreleased2 ==========3 4 * Fix `app.use` to accept array of middleware without path5+ * deps: depd@0.4.56+ * deps: send@0.9.27+ - deps: depd@0.4.58+ - deps: etag@~1.3.19+ - deps: range-parser@~1.0.210 11 4.9.0 / 2014-09-0812 ==================13 461 unmodified lines475 - `app.router()` - returns the app Router instance476 - `app.route()` - Proxy to the app's `Router#route()` method to create a new route477 - Router & Route - public API478 479+3.17.2 / 2014-09-15480+===================481+482+ * Use `crc` instead of `buffer-crc32` for speed483+ * deps: connect@2.26.1484+ - deps: body-parser@~1.8.2485+ - deps: depd@0.4.5486+ - deps: express-session@~1.8.2487+ - deps: morgan@~1.3.1488+ - deps: serve-favicon@~2.1.3489+ - deps: serve-static@~1.6.2490+ * deps: depd@0.4.5491+ * deps: send@0.9.2492+ - deps: depd@0.4.5493+ - deps: etag@~1.3.1494+ - deps: range-parser@~1.0.2495+496 3.17.1 / 2014-09-08497 ===================498 499 * Fix error in `req.subdomains` on empty host1751 unmodified linesmodified:package.json+3 added-2 removed
28 unmodified lines293031323333343536374 unmodified lines4243444546464748495025 unmodified lines767778798081828328 unmodified lines "dependencies": { "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", "fresh": "0.2.4",4 unmodified lines "path-to-regexp": "0.1.3", "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", "cookie": "0.1.2",25 unmodified lines "scripts": { "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/" }}