Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query: deprecate extended query parser #4208

Closed
wants to merge 8 commits into from
7 changes: 7 additions & 0 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ app.defaultConfiguration = function defaultConfiguration() {
var env = process.env.NODE_ENV || 'development';

// default settings
this._defaultExtendedQueryParser = true
this.enable('x-powered-by');
this.set('etag', 'weak');
this.set('env', env);
this.set('query parser', 'extended');
this._defaultExtendedQueryParser = true
this.set('subdomain offset', 2);
this.set('trust proxy', false);

Expand Down Expand Up @@ -141,6 +143,10 @@ app.lazyrouter = function lazyrouter() {
strict: this.enabled('strict routing')
});

if (this._defaultExtendedQueryParser) {
deprecate('default extended query parser deprecated, set explicitly to override')
}

this._router.use(query(this.get('query parser fn')));
this._router.use(middleware.init(this));
}
Expand Down Expand Up @@ -367,6 +373,7 @@ app.set = function set(setting, val) {
break;
case 'query parser':
this.set('query parser fn', compileQueryParser(val));
this._defaultExtendedQueryParser = false
break;
case 'trust proxy':
this.set('trust proxy fn', compileTrust(val));
Expand Down