Skip to content

Commit 6073b6c

Browse files
committed
http: updated docs
1 parent 9228924 commit 6073b6c

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

doc/api/cli.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -957,10 +957,22 @@ added:
957957
- v10.19.0
958958
-->
959959

960-
Use an insecure HTTP parser that accepts invalid HTTP headers. This may allow
961-
interoperability with non-conformant HTTP implementations. It may also allow
962-
request smuggling and other HTTP attacks that rely on invalid headers being
963-
accepted. Avoid using this option.
960+
Enable leniency flags on the HTTP parser. This may allow
961+
interoperability with non-conformant HTTP implementations.
962+
963+
When enabled, the parser will accept the following:
964+
965+
* Invalid HTTP headers values.
966+
* Invalid HTTP versions.
967+
* Allow message containing both `Transfer-Encoding`
968+
and `Content-Length` headers.
969+
* Allow extra data after message when `Connection: close` is present.
970+
* Allow extra trasfer encodings after `chunked` has been provided.
971+
* Allow `\n` to be used as token separator instead of `\r\n`.
972+
* Allow `\r\n` not to be provided after a chunk.
973+
974+
All the above will expose your application to request smuggling
975+
or poisoning attack. Avoid using this option.
964976

965977
### `--jitless`
966978

doc/api/http.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -3250,9 +3250,9 @@ changes:
32503250
`readableHighWaterMark` and `writableHighWaterMark`. This affects
32513251
`highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
32523252
**Default:** See [`stream.getDefaultHighWaterMark()`][].
3253-
* `insecureHTTPParser` {boolean} Use an insecure HTTP parser that accepts
3254-
invalid HTTP headers when `true`. Using the insecure parser should be
3255-
avoided. See [`--insecure-http-parser`][] for more information.
3253+
* `insecureHTTPParser` {boolean} If set to `true`, it will use a HTTP parser
3254+
with leniency flags enabled. Using the insecure parser should be avoided.
3255+
See [`--insecure-http-parser`][] for more information.
32563256
**Default:** `false`.
32573257
* `IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage`
32583258
class to be used. Useful for extending the original `IncomingMessage`.
@@ -3512,9 +3512,9 @@ changes:
35123512
request to. **Default:** `'localhost'`.
35133513
* `hostname` {string} Alias for `host`. To support [`url.parse()`][],
35143514
`hostname` will be used if both `host` and `hostname` are specified.
3515-
* `insecureHTTPParser` {boolean} Use an insecure HTTP parser that accepts
3516-
invalid HTTP headers when `true`. Using the insecure parser should be
3517-
avoided. See [`--insecure-http-parser`][] for more information.
3515+
* `insecureHTTPParser` {boolean} If set to `true`, it will use a HTTP parser
3516+
with leniency flags enabled. Using the insecure parser should be avoided.
3517+
See [`--insecure-http-parser`][] for more information.
35183518
**Default:** `false`
35193519
* `joinDuplicateHeaders` {boolean} It joins the field line values of
35203520
multiple headers in a request with `, ` instead of discarding

0 commit comments

Comments
 (0)