From a92b5d5cf4457c2da95d8404b08cfd06a426a2fa Mon Sep 17 00:00:00 2001 From: Tom <53571657+tmclo@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:43:48 +0100 Subject: [PATCH] fix: use space in accept-encoding values (#1572) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix for issue #1571 * Update README.md Co-authored-by: Jimmy Wärting --- README.md | 2 +- src/request.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 07e0c51ba..fce3d8f13 100644 --- a/README.md +++ b/README.md @@ -537,7 +537,7 @@ 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-Encoding` | `gzip, deflate, br` (when `options.compress === true`) | | `Accept` | `*/*` | | `Connection` | `close` _(when no `options.agent` is present)_ | | `Content-Length` | _(automatically calculated, if possible)_ | diff --git a/src/request.js b/src/request.js index a63f7e606..38f33df33 100644 --- a/src/request.js +++ b/src/request.js @@ -280,7 +280,7 @@ export const getNodeRequestOptions = request => { // HTTP-network-or-cache fetch step 2.15 if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate,br'); + headers.set('Accept-Encoding', 'gzip, deflate, br'); } let {agent} = request;