File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ function OutgoingMessage(options) {
152
152
153
153
this [ kErrored ] = null ;
154
154
this [ kHighWaterMark ] = options ?. highWaterMark ?? getDefaultHighWaterMark ( ) ;
155
- this [ kRejectNonStandardBodyWrites ] = options ?. rejectNonStandardBodyWrites ?? true ;
155
+ this [ kRejectNonStandardBodyWrites ] = options ?. rejectNonStandardBodyWrites ?? false ;
156
156
}
157
157
ObjectSetPrototypeOf ( OutgoingMessage . prototype , Stream . prototype ) ;
158
158
ObjectSetPrototypeOf ( OutgoingMessage , Stream ) ;
Original file line number Diff line number Diff line change @@ -490,7 +490,7 @@ function storeHTTPOptions(options) {
490
490
validateBoolean ( rejectNonStandardBodyWrites , 'options.rejectNonStandardBodyWrites' ) ;
491
491
this . rejectNonStandardBodyWrites = rejectNonStandardBodyWrites ;
492
492
} else {
493
- this . rejectNonStandardBodyWrites = true
493
+ this . rejectNonStandardBodyWrites = false
494
494
}
495
495
}
496
496
Original file line number Diff line number Diff line change @@ -24,17 +24,10 @@ const common = require('../common');
24
24
const assert = require ( 'assert' ) ;
25
25
const http = require ( 'http' ) ;
26
26
27
- // should be using common.mustCall on both req res callbacks provided to createServer
28
27
{
29
28
const server = http . createServer ( ( req , res ) => {
30
- assert . throws ( ( ) => {
31
- res . write ( 'this is content' ) ;
32
- } , {
33
- code : 'ERR_HTTP_BODY_NOT_ALLOWED' ,
34
- name : 'Error' ,
35
- message : 'Adding content for this request method or response status is not allowed.'
36
- } ) ;
37
- res . end ( ) ;
29
+ res . writeHead ( 200 ) ;
30
+ res . end ( 'this is content' ) ;
38
31
} ) ;
39
32
server . listen ( 0 ) ;
40
33
You can’t perform that action at this time.
0 commit comments