Skip to content

Commit fe60c88

Browse files
committed
Improve test documentation.
1 parent b5d7dd0 commit fe60c88

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,14 @@ user response. There is currently no way to short-circuit this behavior.
278278

279279
#### limit
280280

281-
This sets the body size limit (default: `1mb`). If the body size is larger than the specified (or default) limit,
282-
a `413 Request Entity Too Large` error will be returned. See [bytes.js](https://www.npmjs.com/package/bytes) for
283-
a list of supported formats.
281+
When `parseReqBody` is true, this is passed to `getRawBody`[https://www.npmjs.com/package/raw-body], and accepts the same arguments.
282+
283+
This limits the request body size when `parseReqBody` is true. (default: `1mb`).
284+
285+
If the body size is larger than the specified (or default) limit, a `413
286+
Request Entity Too Large` error will be returned. See
287+
[bytes.js](https://www.npmjs.com/package/bytes) for a list of supported
288+
formats.
284289

285290
```js
286291
app.use('/proxy', proxy('www.google.com', {
@@ -471,18 +476,19 @@ app.use('/proxy', proxy('www.google.com', {
471476
```
472477

473478
#### parseReqBody
479+
[default: true]
480+
481+
The `parseReqBody` option allows you to suppress parsing of the request
482+
body. (The request body is parsed to make it available for modification and
483+
decoration before being added to the proxy request.)
474484

475-
The ```parseReqBody``` option allows you to control parsing the request body.
476485
For example, disabling body parsing is useful for large uploads where it would be inefficient
477486
to hold the data in memory.
478487

479-
##### Note: this setting is required for binary uploads. A future version of this library may handle this for you.
480-
481-
This defaults to true in order to preserve legacy behavior.
482-
483-
When false, no action will be taken on the body and accordingly ```req.body``` will no longer be set.
488+
When false, no action will be taken on the body and accordingly `req.body` will no longer be set.
484489

485-
Note that setting this to false overrides ```reqAsBuffer``` and ```reqBodyEncoding``` below.
490+
#### Note: set this to false for binary uploads.
491+
#### Note that setting this to false obviates `reqAsBuffer` and `reqBodyEncoding` settings.
486492

487493
```js
488494
app.use('/proxy', proxy('www.google.com', {

0 commit comments

Comments
 (0)