File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2427,8 +2427,9 @@ it will switch to implicit header mode and flush the implicit headers.
24272427This sends a chunk of the response body. This method may
24282428be called multiple times to provide successive parts of the body.
24292429
2430- Writing to the body is not allowed when the request method or response status
2431- do not support content. If an attempt is made to write to the body for a
2430+ If ` rejectNonStandardBodyWrites ` is set to true in ` createServer `
2431+ then writing to the body is not allowed when the request method or response
2432+ status do not support content. If an attempt is made to write to the body for a
24322433HEAD request or as part of a ` 204 ` or ` 304 ` response, a synchronous ` Error `
24332434with the code ` ERR_HTTP_BODY_NOT_ALLOWED ` is thrown.
24342435
@@ -3571,6 +3572,9 @@ changes:
35713572 * ` uniqueHeaders` {Array} A list of response headers that should be sent only
35723573 once. If the header's value is an array, the items will be joined
35733574 using ` ; ` .
3575+ * ` rejectNonStandardBodyWrites` {boolean} If set to ` true ` , an error is thrown
3576+ when writing to an HTTP response which does not have a body.
3577+ **Default:** ` false ` .
35743578
35753579* ` requestListener` {Function}
35763580
You can’t perform that action at this time.
0 commit comments