You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -174,8 +173,7 @@ exports.compileQueryParser = function compileQueryParser(val) {
174
173
casefalse:
175
174
break;
176
175
case'extended':
177
-
fn=parseExtendedQueryString;
178
-
break;
176
+
thrownewTypeError("query parser 'extended' is no longer supported; use: `app.set('query parser', str => qs.parse(str, { allowPrototypes: true }))` to replicate the old behavior");
179
177
default:
180
178
thrownewTypeError('unknown value for query parser function: '+val);
181
179
}
@@ -255,17 +253,3 @@ function createETagGenerator (options) {
it('should parse parameters with dots',function(done){
35
-
varapp=createApp('extended');
36
+
varapp=createApp(qs.parse);
36
37
37
38
request(app)
38
39
.get('/?user.name=tj')
39
40
.expect(200,'{"user.name":"tj"}',done);
40
41
});
41
42
});
42
43
44
+
describe('when "query parser" is set to extended',function(){
45
+
it('should throw with a helpful error message',function(){
46
+
assert.throws(()=>createApp('extended'),
47
+
newTypeError("query parser 'extended' is no longer supported; use: `app.set('query parser', str => qs.parse(str, { allowPrototypes: true }))` to replicate the old behavior")
48
+
);
49
+
});
50
+
});
51
+
43
52
describe('when "query parser" is simple',function(){
44
53
it('should not parse complex keys',function(done){
0 commit comments