mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
use cookie key when setting cookie for jar
This commit is contained in:
parent
036b179ffe
commit
789257fd4a
2 changed files with 4 additions and 4 deletions
|
@ -56,7 +56,7 @@ module.exports = ClsiCookieManager =
|
|||
if err?
|
||||
logger.err err:err, project_id:project_id, "error getting server id"
|
||||
return callback(err)
|
||||
serverCookie = request.cookie("clsiserver=#{serverId}")
|
||||
serverCookie = request.cookie("#{Settings.clsiCookieKey}=#{serverId}")
|
||||
jar = request.jar()
|
||||
jar.setCookie serverCookie, Settings.apis.clsi.url
|
||||
callback(null, jar)
|
||||
|
|
|
@ -112,9 +112,9 @@ describe "ClsiCookieManager", ->
|
|||
@ClsiCookieManager._getServerId = sinon.stub().callsArgWith(1, null, "clsi-11")
|
||||
|
||||
it "should return a jar with the cookie set populated from redis", (done)->
|
||||
@ClsiCookieManager.getCookieJar @project_id, (err, jar)->
|
||||
jar._jar.store.idx["clsi.example.com"]["/"].clsiserver.key.should.equal "clsiserver"
|
||||
jar._jar.store.idx["clsi.example.com"]["/"].clsiserver.value.should.equal "clsi-11"
|
||||
@ClsiCookieManager.getCookieJar @project_id, (err, jar)=>
|
||||
jar._jar.store.idx["clsi.example.com"]["/"][@settings.clsiCookieKey].key.should.equal
|
||||
jar._jar.store.idx["clsi.example.com"]["/"][@settings.clsiCookieKey].value.should.equal "clsi-11"
|
||||
done()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue