diff --git a/README.md b/README.md index fdd43aa..f3e177a 100644 --- a/README.md +++ b/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. diff --git a/src/request.js b/src/request.js index 4a32161..b8b7ea1 100644 --- a/src/request.js +++ b/src/request.js @@ -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