Add X-Watcher-Key in request header for watcher client

This commit is contained in:
Anthony Corbacho 2016-11-03 16:42:57 +09:00
parent e2d3053a95
commit 8f7e1b3134

View file

@ -35,6 +35,7 @@ import org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.scheduler.Schedul
import org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.scheduler.ZeppelinHeartbeat;
import org.apache.zeppelin.notebook.socket.Message;
import org.apache.zeppelin.notebook.socket.Message.OP;
import org.apache.zeppelin.util.WatcherSecurityKey;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
@ -168,6 +169,7 @@ public class ZeppelinClient {
private Session openWatcherSession() {
ClientUpgradeRequest request = new ClientUpgradeRequest();
request.setHeader(WatcherSecurityKey.HTTP_HEADER, WatcherSecurityKey.getKey());
WatcherWebsocket socket = WatcherWebsocket.createInstace();
Future<Session> future = null;
Session session = null;