From 220daff655b46ffb1f1c627e9341a48e11b84c7b Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 17 Jan 2022 16:00:47 +0000 Subject: [PATCH] Merge pull request #6384 from overleaf/jpa-fix-proxying-of-json [web] fix proxying of responses from other services GitOrigin-RevId: ac1ecc02c06e353f8379fadb47824a46672610e5 --- services/web/app/src/Features/Compile/ClsiManager.js | 1 + services/web/test/unit/src/Compile/ClsiManagerTests.js | 3 +++ services/web/test/unit/src/helpers/MockResponse.js | 1 + 3 files changed, 5 insertions(+) diff --git a/services/web/app/src/Features/Compile/ClsiManager.js b/services/web/app/src/Features/Compile/ClsiManager.js index f01ae3b60b..95d9d70dcf 100644 --- a/services/web/app/src/Features/Compile/ClsiManager.js +++ b/services/web/app/src/Features/Compile/ClsiManager.js @@ -884,6 +884,7 @@ const ClsiManager = { file: filename, image: req.compile.options.imageName, }, + json: true, method: 'GET', } ClsiManager._makeRequestWithClsiServerId( diff --git a/services/web/test/unit/src/Compile/ClsiManagerTests.js b/services/web/test/unit/src/Compile/ClsiManagerTests.js index 3d7531a4ac..677ce765cc 100644 --- a/services/web/test/unit/src/Compile/ClsiManagerTests.js +++ b/services/web/test/unit/src/Compile/ClsiManagerTests.js @@ -1014,6 +1014,7 @@ describe('ClsiManager', function () { file: 'rootfile.text', image: undefined, }, + json: true, }, 'node-1' ) @@ -1046,6 +1047,7 @@ describe('ClsiManager', function () { method: 'GET', url: `http://clsi.example.com/project/${this.project_id}/user/${this.user_id}/wordcount`, qs: { file: 'main.tex', image: undefined }, + json: true, }, 'node-2' ) @@ -1076,6 +1078,7 @@ describe('ClsiManager', function () { method: 'GET', url: `http://clsi.example.com/project/${this.project_id}/user/${this.user_id}/wordcount`, qs: { file: 'main.tex', image: this.image }, + json: true, }, 'node-3' ) diff --git a/services/web/test/unit/src/helpers/MockResponse.js b/services/web/test/unit/src/helpers/MockResponse.js index 93f759fa71..4b43c46fd1 100644 --- a/services/web/test/unit/src/helpers/MockResponse.js +++ b/services/web/test/unit/src/helpers/MockResponse.js @@ -35,6 +35,7 @@ class MockResponse { sinon.spy(this, 'sendStatus') sinon.spy(this, 'status') sinon.spy(this, 'render') + sinon.spy(this, 'redirect') } header(field, val) {