File tree 3 files changed +5
-36
lines changed
3 files changed +5
-36
lines changed Original file line number Diff line number Diff line change
1
+ unreleased
2
+ ==========
3
+
4
+ * Revert "Improve error message for ` null ` /` undefined ` to ` res.status ` "
5
+
1
6
4.17.0 / 2019-05-16
2
7
===================
3
8
Original file line number Diff line number Diff line change @@ -64,10 +64,6 @@ var charsetRegExp = /;\s*charset\s*=/;
64
64
*/
65
65
66
66
res . status = function status ( code ) {
67
- if ( code === undefined || code === null ) {
68
- throw new TypeError ( 'code argument is required to res.status' )
69
- }
70
-
71
67
this . statusCode = code ;
72
68
return this ;
73
69
} ;
Original file line number Diff line number Diff line change @@ -16,37 +16,5 @@ describe('res', function(){
16
16
. expect ( 'Created' )
17
17
. expect ( 201 , done ) ;
18
18
} )
19
-
20
- describe ( 'when code is undefined' , function ( ) {
21
- it ( 'should throw a TypeError' , function ( done ) {
22
- var app = express ( )
23
-
24
- app . use ( function ( req , res ) {
25
- res . status ( undefined ) . send ( 'OK' )
26
- } )
27
-
28
- request ( app )
29
- . get ( '/' )
30
- . expect ( 500 )
31
- . expect ( / T y p e E r r o r : c o d e a r g u m e n t i s r e q u i r e d t o r e s .s t a t u s / )
32
- . end ( done )
33
- } )
34
- } )
35
-
36
- describe ( 'when code is null' , function ( ) {
37
- it ( 'should throw a TypeError' , function ( done ) {
38
- var app = express ( )
39
-
40
- app . use ( function ( req , res ) {
41
- res . status ( null ) . send ( 'OK' )
42
- } )
43
-
44
- request ( app )
45
- . get ( '/' )
46
- . expect ( 500 )
47
- . expect ( / T y p e E r r o r : c o d e a r g u m e n t i s r e q u i r e d t o r e s .s t a t u s / )
48
- . end ( done )
49
- } )
50
- } )
51
19
} )
52
20
} )
You can’t perform that action at this time.
0 commit comments