Skip to content

Commit 17f6323

Browse files
authored
docs(readme): spelling and grammar fixes (#401)
Signed-off-by: Frazer Smith <frazer.dev@icloud.com>
1 parent e6330d2 commit 17f6323

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ npm i @fastify/reply-from
1414
```
1515

1616
## Compatibility with @fastify/multipart
17-
`@fastify/reply-from` and [`@fastify/multipart`](https://github.com/fastify/fastify-multipart) should not be registered as sibling plugins nor should they be registered in plugins which have a parent-child relationship.`<br>` The two plugins are incompatible, in the sense that the behavior of `@fastify/reply-from` might not be the expected one when the above-mentioned conditions are not respected.`<br>` This is due to the fact that `@fastify/multipart` consumes the multipart content by parsing it, hence this content is not forwarded to the target service by `@fastify/reply-from`.`<br>`
17+
`@fastify/reply-from` and [`@fastify/multipart`](https://github.com/fastify/fastify-multipart) should not be registered as sibling plugins nor should they be registered in plugins that have a parent-child relationship.`<br>` The two plugins are incompatible, in the sense that the behavior of `@fastify/reply-from` might not be the expected one when the above-mentioned conditions are not respected.`<br>` This is due to the fact that `@fastify/multipart` consumes the multipart content by parsing it, hence this content is not forwarded to the target service by `@fastify/reply-from`.`<br>`
1818
However, the two plugins may be used within the same fastify instance, at the condition that they belong to disjoint branches of the fastify plugins hierarchy tree.
1919

2020
## Usage
@@ -83,10 +83,10 @@ proxy.register(require('@fastify/reply-from'), {
8383
#### `undici`
8484

8585
By default, [undici](https://github.com/nodejs/undici) will be used to perform the HTTP/1.1
86-
requests. Enabling this flag should guarantee
86+
requests. Enabling this option should guarantee
8787
20-50% more throughput.
8888

89-
This flag could controls the settings of the undici client, like so:
89+
This option controls the settings of the undici client, like so:
9090

9191
```js
9292
proxy.register(require('@fastify/reply-from'), {
@@ -167,7 +167,7 @@ proxy.register(require('@fastify/reply-from'), {
167167

168168
#### `http2`
169169

170-
You can either set `http2` to `true` or set the settings object to connect to a HTTP/2 server.
170+
You can either set `http2` to `true` or set the settings object to connect to an HTTP/2 server.
171171
The `http2` settings object has the shape of:
172172

173173
```js
@@ -188,7 +188,7 @@ proxy.register(require('@fastify/reply-from'), {
188188

189189
#### `disableRequestLogging`
190190

191-
By default package will issue log messages when a request is received. By setting this option to true, these log messages will be disabled.
191+
By default, the package will issue log messages when a request is received. By setting this option to true, these log messages will be disabled.
192192

193193
Default for `disableRequestLogging` will be `false`. To disable the log messages set `disableRequestLogging` to `true`.
194194

@@ -206,7 +206,7 @@ The number of parsed URLs that will be cached. Default: `100`.
206206
#### `disableCache`
207207

208208
This option will disable the URL caching.
209-
This cache is dedicated to reduce the amount of URL object generation.
209+
This cache is dedicated to reducing the amount of URL object generation.
210210
Generating URLs is a main bottleneck of this module, please disable this cache with caution.
211211

212212
#### `contentTypesToEncode`
@@ -231,7 +231,7 @@ This plugin will always retry on 503 errors, _unless_ `retryMethods` does not co
231231

232232
#### `globalAgent`
233233

234-
Enables the possibility to explictly opt-in for global agents.
234+
Enables the possibility to explicitly opt-in for global agents.
235235

236236
Usage for undici global agent:
237237

@@ -274,7 +274,7 @@ By Default: `false`
274274

275275
This plugin will always retry on `GET` requests that returns 503 errors, _unless_ `retryMethods` does not contain `GET`.
276276

277-
This option set the limit on how many times the plugin should retry the request, specifically for 503 errors.
277+
This option sets the limit on how many times the plugin should retry the request, specifically for 503 errors.
278278

279279
By Default: 10
280280

@@ -293,7 +293,7 @@ If a `handler` is passed to the `retryDelay` object the onus is on the client to
293293
- `res` is the raw response returned by the underlying agent (if available) __Note__: this object is not a Fastify response, but instead the low-level response from the agent. This property may be null if no response was obtained at all, like from a connection reset or timeout.
294294
- `attempt` in the object callback refers to the current retriesAttempt number. You are given the freedom to use this in concert with the retryCount property set to handle retries
295295
- `getDefaultRetry` refers to the default retry handler. If this callback returns not null and you wish to handle those case of errors simply invoke it as done below.
296-
- `retriesCount` refers to the retriesCount property a client passes to reply-from. Note if the client does not explicitly set this value it will default to 0. The objective value here is to avoid hard-coding and seeing the retriesCount set. It is your perogative to ensure that you ensure the value here is as you wish (and not `0` if not intended to be as a result of a lack of not setting it).
296+
- `retriesCount` refers to the retriesCount property a client passes to reply-from. Note if the client does not explicitly set this value it will default to 0. The objective value here is to avoid hard-coding and seeing the retriesCount set. It is your prerogative to ensure that you ensure the value here is as you wish (and not `0` if not intended to be as a result of a lack of not setting it).
297297

298298
Given example
299299

@@ -339,14 +339,14 @@ const customRetryLogic = ({req, res, err, getDefaultRetry}: RetryDetails) => {
339339
The plugin decorates the
340340
[`Reply`](https://fastify.dev/docs/latest/Reference/Reply)
341341
instance with a `from` method, which will reply to the original request
342-
__from the desired source__. The options allows to override any part of
342+
__from the desired source__. The options allows overrides of any part of
343343
the request or response being sent or received to/from the source.
344344

345345
**Note: If `base` is specified in plugin options, the `source` here should not override the host/origin.**
346346

347347
#### `onResponse(request, reply, response)`
348348

349-
Called when a HTTP response is received from the source. Passed the original source `request`, the in-progress reply to the source as `reply`, and the ongoing `response` from the upstream server.
349+
Called when an HTTP response is received from the source. Passed the original source `request`, the in-progress reply to the source as `reply`, and the ongoing `response` from the upstream server.
350350

351351
The default behavior is `reply.send(response.stream)`, which will be disabled if the
352352
option is specified.
@@ -367,10 +367,10 @@ the `content-length` header.
367367

368368
#### `onError(reply, error)`
369369

370-
Called when a HTTP response is received with error from the source.
370+
Called when an HTTP response is received with error from the source.
371371
The default behavior is `reply.send(error)`, which will be disabled if the
372372
option is specified.
373-
It must reply the error.
373+
It must reply with the error.
374374

375375
#### `rewriteHeaders(headers, request)`
376376

@@ -387,7 +387,7 @@ It must return the new headers object.
387387

388388
#### `getUpstream(request, base)`
389389

390-
Called to get upstream destination, before the request is being sent. Useful when you want to decide which target server to call based on the request data.
390+
Called to get upstream destination, before the request is sent. Useful when you want to decide which target server to call based on the request data.
391391
Helpful for a gradual rollout of new services.
392392
Parameters are the Fastify request and the base string from the plugin options.
393393
It must return the upstream destination.

0 commit comments

Comments
 (0)