mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04:00
improve send calls and return correct stuff from _makeRequest
This commit is contained in:
parent
18560d8621
commit
616630200a
3 changed files with 10 additions and 2 deletions
|
@ -44,7 +44,11 @@ module.exports = ClsiManager =
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, project_id:project_id, url:opts?.url, "error making request to clsi"
|
logger.err err:err, project_id:project_id, url:opts?.url, "error making request to clsi"
|
||||||
return callback(err)
|
return callback(err)
|
||||||
ClsiCookieManager.setServerId project_id, response, callback
|
ClsiCookieManager.setServerId project_id, response, (err)->
|
||||||
|
if err?
|
||||||
|
logger.warn err:err, project_id:project_id, "error setting server id"
|
||||||
|
|
||||||
|
return callback err, response, body
|
||||||
|
|
||||||
|
|
||||||
_getCompilerUrl: (compileGroup) ->
|
_getCompilerUrl: (compileGroup) ->
|
||||||
|
|
|
@ -33,7 +33,7 @@ module.exports = CompileController =
|
||||||
CompileManager.compile project_id, user_id, options, (error, status, outputFiles, output, limits) ->
|
CompileManager.compile project_id, user_id, options, (error, status, outputFiles, output, limits) ->
|
||||||
return next(error) if error?
|
return next(error) if error?
|
||||||
res.contentType("application/json")
|
res.contentType("application/json")
|
||||||
res.send 200, JSON.stringify {
|
res.status(200).send JSON.stringify {
|
||||||
status: status
|
status: status
|
||||||
outputFiles: outputFiles
|
outputFiles: outputFiles
|
||||||
compileGroup: limits?.compileGroup
|
compileGroup: limits?.compileGroup
|
||||||
|
|
|
@ -63,6 +63,10 @@ class MockResponse
|
||||||
@body = body if body
|
@body = body if body
|
||||||
@callback() if @callback?
|
@callback() if @callback?
|
||||||
|
|
||||||
|
status: (@statusCode)->
|
||||||
|
return @
|
||||||
|
|
||||||
|
|
||||||
setHeader: (header, value) ->
|
setHeader: (header, value) ->
|
||||||
@headers[header] = value
|
@headers[header] = value
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue