File tree 1 file changed +14
-7
lines changed
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,20 @@ server.listen(0, common.mustCall(function() {
42
42
response . removeHeader ( denormalised ) ;
43
43
assert . strictEqual ( response . hasHeader ( denormalised ) , false ) ;
44
44
45
- assert . throws ( function ( ) {
46
- response . setHeader ( ':status' , 'foobar' ) ;
47
- } , common . expectsError ( {
48
- code : 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED' ,
49
- type : Error ,
50
- message : 'Cannot set HTTP/2 pseudo-headers'
51
- } ) ) ;
45
+ [
46
+ ':status' ,
47
+ ':method' ,
48
+ ':path' ,
49
+ ':authority' ,
50
+ ':scheme'
51
+ ] . forEach ( ( header ) => assert . throws (
52
+ ( ) => response . setHeader ( header , 'foobar' ) ,
53
+ common . expectsError ( {
54
+ code : 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED' ,
55
+ type : Error ,
56
+ message : 'Cannot set HTTP/2 pseudo-headers'
57
+ } )
58
+ ) ) ;
52
59
assert . throws ( function ( ) {
53
60
response . setHeader ( real , null ) ;
54
61
} , common . expectsError ( {
You can’t perform that action at this time.
0 commit comments