diff --git a/History.md b/History.md index 9e5d35ce59..028317d933 100644 --- a/History.md +++ b/History.md @@ -3,6 +3,8 @@ This incorporates all changes after 4.17.1 up to 4.17.2. + * change: + - query parser setting defaults to `'simple'` * deps: body-parser@2.0.0-beta.1 - `req.body` is no longer always initialized to `{}` - `urlencoded` parser now defaults `extended` to `false` diff --git a/lib/application.js b/lib/application.js index c4d69e9ed6..85967249c4 100644 --- a/lib/application.js +++ b/lib/application.js @@ -89,7 +89,7 @@ app.defaultConfiguration = function defaultConfiguration() { this.enable('x-powered-by'); this.set('etag', 'weak'); this.set('env', env); - this.set('query parser', 'extended'); + this.set('query parser', 'simple') this.set('subdomain offset', 2); this.set('trust proxy', false); diff --git a/test/req.query.js b/test/req.query.js index 869fbc360b..067d452107 100644 --- a/test/req.query.js +++ b/test/req.query.js @@ -12,12 +12,12 @@ describe('req', function(){ .expect(200, '{}', done); }); - it('should default to parse complex keys', function (done) { + it('should default to parse simple keys', function (done) { var app = createApp(); request(app) .get('/?user[name]=tj') - .expect(200, '{"user":{"name":"tj"}}', done); + .expect(200, '{"user[name]":"tj"}', done); }); describe('when "query parser" is extended', function () {