فهرست منبع

Merge pull request #6384 from overleaf/jpa-fix-proxying-of-json

[web] fix proxying of responses from other services

GitOrigin-RevId: ac1ecc02c06e353f8379fadb47824a46672610e5
Jakob Ackermann 4 سال پیش
والد
کامیت
220daff655

+ 1 - 0
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(

+ 3 - 0
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'
           )

+ 1 - 0
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) {