mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
use cookie key when setting cookie for jar
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user