Skip to content
Myr

utilize connects new `query()` middleware

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 9a8b868 · Browse files · 2 files+1 added−26 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+1 added−26 removed

  • tests:+0 added−20 removed
  • other:+1 added−6 removed

2 files+1 added−26 removed

modified:lib/http.js+1 added-6 removed
66 unmodified lines
67 this._dynamicLocals = {};6869 this.set('home', '/');70 this.set('env', process.env.NODE_ENV || 'development');71 this.use(connect.query());7273 // expose objects to each other74 this.use(function(req, res, next){75 var charset;
6 unmodified lines
8283 // charset84 if (charset = self.set('charset')) res.charset = charset;8585 // assign req.query86 if (req.url.indexOf('?') > 0) {87 var query = url.parse(req.url).query;88 req.query = qs.parse(query);89 }9086 /**87 * Assign several locals with the given `obj`,88 * or return the locals.89 *
463 unmodified lines
modified:test/express.test.js-20 removed
287 unmodified lines
288 app.disabled('some feature').should.be.true;289 app.disabled('something else').should.be.true;290 },291 292 'test middleware precedence': function(){293 var app = express.createServer();294 295 app.use(connect.bodyParser());296297 assert.equal(2, app.stack.length);298 299 app.post('/', function(req, res){300 res.send(JSON.stringify(req.body || ''));301 });302 app.get('/', function(){303304 });305 assert.equal(3, app.stack.length);306307 assert.response(app,308 { url: '/', method: 'POST', data: 'name=tj', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }},309 { body: '{"name":"tj"}' });310 },311 292 'test mounting': function(){293 var called294 , app = express.createServer()295 , blog = express.createServer()
118 unmodified lines