improve send calls and return correct stuff from _makeRequest

This commit is contained in:
Henry Oswald 2016-04-20 17:00:17 +01:00
parent 18560d8621
commit 616630200a
3 changed files with 10 additions and 2 deletions

View file

@ -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) ->

View file

@ -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

View file

@ -63,6 +63,10 @@ class MockResponse
@body = body if body
@callback() if @callback?
status: (@statusCode)->
return @
setHeader: (header, value) ->
@headers[header] = value