From 496a63cf23c2bc0ef2e5612adc926a0b9bd47a42 Mon Sep 17 00:00:00 2001 From: Mathias Jakobsen Date: Fri, 30 Aug 2024 09:11:46 +0100 Subject: [PATCH] Merge pull request #20058 from overleaf/mj-promisify-tpr [third-party-references] Promisify third-party-references GitOrigin-RevId: cfc462abaca95ed10798b3d1756950f2997a5947 --- libraries/fetch-utils/index.js | 2 +- package-lock.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/fetch-utils/index.js b/libraries/fetch-utils/index.js index 5ac0fc2ce5..b2e66e4350 100644 --- a/libraries/fetch-utils/index.js +++ b/libraries/fetch-utils/index.js @@ -21,7 +21,7 @@ async function fetchJson(url, opts = {}) { async function fetchJsonWithResponse(url, opts = {}) { const { fetchOpts } = parseOpts(opts) fetchOpts.headers = fetchOpts.headers ?? {} - fetchOpts.headers.Accept = 'application/json' + fetchOpts.headers.Accept = fetchOpts.headers.Accept ?? 'application/json' const response = await performRequest(url, fetchOpts) if (!response.ok) { diff --git a/package-lock.json b/package-lock.json index 1e745c905b..0c85f1904b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44437,9 +44437,11 @@ "license": "ISC", "dependencies": { "@overleaf/access-token-encryptor": "*", + "@overleaf/fetch-utils": "*", "@overleaf/logger": "*", "@overleaf/metrics": "*", "@overleaf/o-error": "*", + "@overleaf/promise-utils": "*", "@overleaf/settings": "*", "async": "^3.2.5", "body-parser": "^1.19.0", @@ -53128,9 +53130,11 @@ "version": "file:services/third-party-references", "requires": { "@overleaf/access-token-encryptor": "*", + "@overleaf/fetch-utils": "*", "@overleaf/logger": "*", "@overleaf/metrics": "*", "@overleaf/o-error": "*", + "@overleaf/promise-utils": "*", "@overleaf/settings": "*", "@types/simple-oauth2": "^5.0.7", "async": "^3.2.5",