Fix default user agent string (#818)
Co-authored-by: Antoni Kepinski <xxczaki@pm.me>
This commit is contained in:
parent
ca4703dd15
commit
b3878b9a3e
17
README.md
17
README.md
|
@ -427,14 +427,15 @@ The default values are shown after each option key.
|
|||
|
||||
If no values are set, the following request headers will be sent automatically:
|
||||
|
||||
| Header | Value |
|
||||
| ------------------- | -------------------------------------------------------- |
|
||||
| `Accept-Encoding` | `gzip,deflate,br` _(when `options.compress === true`)_ |
|
||||
| `Accept` | `*/*` |
|
||||
| `Connection` | `close` _(when no `options.agent` is present)_ |
|
||||
| `Content-Length` | _(automatically calculated, if possible)_ |
|
||||
| `Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ |
|
||||
| `User-Agent` | `node-fetch (+https://github.com/node-fetch/node-fetch)` |
|
||||
| Header | Value |
|
||||
| ------------------- | ------------------------------------------------------ |
|
||||
| `Accept-Encoding` | `gzip,deflate,br` _(when `options.compress === true`)_ |
|
||||
| `Accept` | `*/*` |
|
||||
| `Connection` | `close` _(when no `options.agent` is present)_ |
|
||||
| `Content-Length` | _(automatically calculated, if possible)_ |
|
||||
| `Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ |
|
||||
| `User-Agent` | `node-fetch` |
|
||||
|
||||
|
||||
Note: when `body` is a `Stream`, `Content-Length` is not set automatically.
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ export function getNodeRequestOptions(request) {
|
|||
|
||||
// HTTP-network-or-cache fetch step 2.11
|
||||
if (!headers.has('User-Agent')) {
|
||||
headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
|
||||
headers.set('User-Agent', 'node-fetch');
|
||||
}
|
||||
|
||||
// HTTP-network-or-cache fetch step 2.15
|
||||
|
|
Loading…
Reference in New Issue