@@ -220,22 +220,19 @@ describe('bodyParser.urlencoded()', function () {
220
220
} )
221
221
} )
222
222
223
-
224
223
describe ( 'with depth option' , function ( ) {
225
224
describe ( 'when custom value set' , function ( ) {
226
-
227
225
it ( 'should reject non possitive numbers' , function ( ) {
228
226
assert . throws ( createServer . bind ( null , { extended : true , depth : - 1 } ) ,
229
227
/ T y p e E r r o r : o p t i o n d e p t h m u s t b e a z e r o o r a p o s i t i v e n u m b e r / )
230
228
assert . throws ( createServer . bind ( null , { extended : true , depth : NaN } ) ,
231
229
/ T y p e E r r o r : o p t i o n d e p t h m u s t b e a z e r o o r a p o s i t i v e n u m b e r / )
232
- assert . throws ( createServer . bind ( null , { extended : true , depth : " beep" } ) ,
230
+ assert . throws ( createServer . bind ( null , { extended : true , depth : ' beep' } ) ,
233
231
/ T y p e E r r o r : o p t i o n d e p t h m u s t b e a z e r o o r a p o s i t i v e n u m b e r / )
234
232
} )
235
233
236
-
237
234
it ( 'should parse up to the specified depth' , function ( done ) {
238
- this . server = createServer ( { extended :true , depth : 10 } )
235
+ this . server = createServer ( { extended : true , depth : 10 } )
239
236
request ( this . server )
240
237
. post ( '/' )
241
238
. set ( 'Content-Type' , 'application/x-www-form-urlencoded' )
@@ -244,15 +241,14 @@ describe('bodyParser.urlencoded()', function () {
244
241
} )
245
242
246
243
it ( 'should not parse beyond the specified depth' , function ( done ) {
247
- this . server = createServer ( { extended :true , depth : 1 } )
244
+ this . server = createServer ( { extended : true , depth : 1 } )
248
245
request ( this . server )
249
246
. post ( '/' )
250
247
. set ( 'Content-Type' , 'application/x-www-form-urlencoded' )
251
248
. send ( 'a[b][c][d][e]=value' )
252
249
. expect ( 400 , '[querystring.parse.rangeError] The input exceeded the depth' , done )
253
250
} )
254
251
} )
255
-
256
252
257
253
describe ( 'when default value' , function ( ) {
258
254
before ( function ( ) {
@@ -265,7 +261,7 @@ describe('bodyParser.urlencoded()', function () {
265
261
deepObject += '[p]'
266
262
}
267
263
deepObject += '=value'
268
-
264
+
269
265
request ( this . server )
270
266
. post ( '/' )
271
267
. set ( 'Content-Type' , 'application/x-www-form-urlencoded' )
@@ -281,21 +277,19 @@ describe('bodyParser.urlencoded()', function () {
281
277
} )
282
278
283
279
it ( 'should not parse beyond the specified depth' , function ( done ) {
284
- var deepObject = 'a' ;
280
+ var deepObject = 'a'
285
281
for ( var i = 0 ; i < 33 ; i ++ ) {
286
- deepObject += '[p]' ;
282
+ deepObject += '[p]'
287
283
}
288
- deepObject += '=value' ;
284
+ deepObject += '=value'
289
285
290
286
request ( this . server )
291
287
. post ( '/' )
292
288
. set ( 'Content-Type' , 'application/x-www-form-urlencoded' )
293
289
. send ( deepObject )
294
- . expect ( 400 , '[querystring.parse.rangeError] The input exceeded the depth' , done ) ;
295
- } ) ;
296
-
290
+ . expect ( 400 , '[querystring.parse.rangeError] The input exceeded the depth' , done )
291
+ } )
297
292
} )
298
-
299
293
} )
300
294
301
295
describe ( 'with inflate option' , function ( ) {
0 commit comments