mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05: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?
|
||||
logger.err err:err, project_id:project_id, url:opts?.url, "error making request to clsi"
|
||||
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) ->
|
||||
|
|
|
@ -33,7 +33,7 @@ module.exports = CompileController =
|
|||
CompileManager.compile project_id, user_id, options, (error, status, outputFiles, output, limits) ->
|
||||
return next(error) if error?
|
||||
res.contentType("application/json")
|
||||
res.send 200, JSON.stringify {
|
||||
res.status(200).send JSON.stringify {
|
||||
status: status
|
||||
outputFiles: outputFiles
|
||||
compileGroup: limits?.compileGroup
|
||||
|
|
|
@ -63,6 +63,10 @@ class MockResponse
|
|||
@body = body if body
|
||||
@callback() if @callback?
|
||||
|
||||
status: (@statusCode)->
|
||||
return @
|
||||
|
||||
|
||||
setHeader: (header, value) ->
|
||||
@headers[header] = value
|
||||
|
||||
|
|
Loading…
Reference in a new issue