From 2ea7ffb3abc8c62cfd5235ba4dbcd040f0235d69 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Sun, 29 May 2016 12:35:26 +0200 Subject: don't enforce to refresh the token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4257210371c4b809e93c174e00677a82c4b196c7 Signed-off-by: José Bollo --- test/websock.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/websock.js') diff --git a/test/websock.js b/test/websock.js index 84465588..c4295536 100644 --- a/test/websock.js +++ b/test/websock.js @@ -27,12 +27,18 @@ AfbWsItf = (function(){ var RETERR = 4; function AfbWsItf(base, onopen, onabort, ctx) { + ctx = ctx || new AfbCtxItf(); var wl = window.location; var u = "ws://"+wl.host+"/"+base; + if (ctx.token) { + u = u + '?x-afb-token=' + ctx.token; + if (ctx.uuid) + u = u + '&x-afb-uuid=' + ctx.uuid; + } this.ws = new (WebSocket || MozWebSocket)(u, [ "x-afb-ws-json1" ]); this.pendings = {}; this.counter = 0; - this.ctx = ctx || new AfbCtxItf(); + this.ctx = ctx; this.ws.onopen = onopen.bind(this); this.ws.onerror = onerror.bind(this); this.ws.onclose = onclose.bind(this); -- cgit 1.2.3-korg