Update dependency isomorphic-fetch to v3 (#9686)
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Bob Silverberg <bob.silverberg@gmail.com>
This commit is contained in:
Родитель
7f936b04da
Коммит
b3785a32e7
|
@ -236,7 +236,7 @@
|
|||
"hot-shots": "8.1.0",
|
||||
"html-entities": "1.3.1",
|
||||
"invariant": "2.2.4",
|
||||
"isomorphic-fetch": "2.2.1",
|
||||
"isomorphic-fetch": "3.0.0",
|
||||
"jed": "1.1.1",
|
||||
"join-url": "2.0.0",
|
||||
"jsdom": "16.4.0",
|
||||
|
|
|
@ -191,8 +191,7 @@ export function callApi({
|
|||
return response.text().then((text) => {
|
||||
// eslint-disable-next-line amo/only-log-strings
|
||||
_log.warn(
|
||||
oneLine`Response from API was not JSON (was Content-Type:
|
||||
${contentType || '[unknown]'})`,
|
||||
oneLine`Response from API was not JSON (was Content-Type: ${contentType})`,
|
||||
{
|
||||
body: text ? text.substring(0, 100) : '[empty]',
|
||||
status: response.status || '[unknown]',
|
||||
|
|
|
@ -448,14 +448,15 @@ describe(__filename, () => {
|
|||
mockWindow.verify();
|
||||
});
|
||||
|
||||
it('logs a warning message when content type is unknown', async () => {
|
||||
it('logs a warning message when content type is not JSON', async () => {
|
||||
const body = 'long body content'.repeat(100);
|
||||
const contentType = 'text/plain';
|
||||
const status = 204;
|
||||
const url = 'some-response-url';
|
||||
|
||||
mockWindow.expects('fetch').returns(
|
||||
createApiResponse({
|
||||
headers: generateHeaders({ 'Content-Type': null }),
|
||||
headers: generateHeaders({ 'Content-Type': contentType }),
|
||||
status,
|
||||
textData: body,
|
||||
url,
|
||||
|
@ -469,7 +470,7 @@ describe(__filename, () => {
|
|||
|
||||
sinon.assert.calledWith(
|
||||
_log.warn,
|
||||
'Response from API was not JSON (was Content-Type: [unknown])',
|
||||
`Response from API was not JSON (was Content-Type: ${contentType})`,
|
||||
{
|
||||
body: body.substring(0, 100),
|
||||
status,
|
||||
|
|
14
yarn.lock
14
yarn.lock
|
@ -9591,7 +9591,15 @@ isobject@^4.0.0:
|
|||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0"
|
||||
integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==
|
||||
|
||||
isomorphic-fetch@2.2.1, isomorphic-fetch@^2.1.1:
|
||||
isomorphic-fetch@3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4"
|
||||
integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==
|
||||
dependencies:
|
||||
node-fetch "^2.6.1"
|
||||
whatwg-fetch "^3.4.1"
|
||||
|
||||
isomorphic-fetch@^2.1.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9"
|
||||
integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=
|
||||
|
@ -11714,7 +11722,7 @@ node-fetch@^1.0.1:
|
|||
encoding "^0.1.11"
|
||||
is-stream "^1.0.1"
|
||||
|
||||
node-fetch@^2.2.0, node-fetch@^2.6.0:
|
||||
node-fetch@^2.2.0, node-fetch@^2.6.0, node-fetch@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
|
||||
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
|
||||
|
@ -17587,7 +17595,7 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5:
|
|||
dependencies:
|
||||
iconv-lite "0.4.24"
|
||||
|
||||
whatwg-fetch@>=0.10.0:
|
||||
whatwg-fetch@>=0.10.0, whatwg-fetch@^3.4.1:
|
||||
version "3.4.1"
|
||||
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz#e5f871572d6879663fa5674c8f833f15a8425ab3"
|
||||
integrity sha512-sofZVzE1wKwO+EYPbWfiwzaKovWiZXf4coEzjGP9b2GBVgQRLQUZ2QcuPpQExGDAW5GItpEm6Tl4OU5mywnAoQ==
|
||||
|
|
Загрузка…
Ссылка в новой задаче