http: prevent writing to the body when not allowed by HTTP spec

PR-URL: https://github.com/nodejs/node/pull/47732
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
Gerrard Lindsay authored and GitHub committed 2023-05-13 17:09:26 +00:00
1 parent 23e6b12edb
commit 5ec0f39a7a
8 files changed
+142 -12

No files matched your search

+5
View File
@@ -1338,6 +1338,11 @@ When using [`fs.cp()`][], `src` or `dest` pointed to an invalid path.
<a id="ERR_FS_CP_FIFO_PIPE"></a>
### `ERR_HTTP_BODY_NOT_ALLOWED`
An error is thrown when writing to an HTTP response which does not allow
contents. <a id="ERR_HTTP_BODY_NOT_ALLOWED"></a>
### `ERR_HTTP_CONTENT_LENGTH_MISMATCH`
Response body size doesn't match with the specified content-length header value.