Skip to content

Commit

Permalink
Zowe Suite v1.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Jul 14, 2021
2 parents 4b34cb1 + 8895363 commit 37122a4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
23 changes: 21 additions & 2 deletions bootstrap/lib/notificationProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ exports.adminNotificationWebsocketRouter = function(context) {
context.wsRouterPatcher(router);
}

const getCookieNameFromRequest = function (req) {
const cookieNames = Object.keys(req.cookies);
const cookieName = cookieNames.find(name => name.startsWith('connect.sid.'));
if (!cookieName) {
context.logger.debug('Cookie not found');
} else {
context.logger.debug(`Cookie name: ${cookieName}`);
}
return cookieName;
}

router.use(function abc(req,res,next) {
context.logger.info('ZWED0001I'+req.method);
next();
Expand Down Expand Up @@ -75,7 +86,11 @@ exports.adminNotificationWebsocketRouter = function(context) {
}
});
router.ws('/',function(ws,req) {
let id = req.cookies["connect.sid." + req.headers['host'].split(":")[1]]
const cookieName = getCookieNameFromRequest(req);
if (!cookieName) {
return;
}
let id = req.cookies[cookieName];
let symbols = Object.getOwnPropertySymbols(req.client)
let asyncId = req.client[symbols[1]]

Expand All @@ -90,7 +105,11 @@ exports.adminNotificationWebsocketRouter = function(context) {
instance_ids[index].push(asyncId)
}
ws.on('close', ()=> {
let id_index = client_ids.indexOf(req.cookies["connect.sid." + req.headers['host'].split(":")[1]])
const cookieName = getCookieNameFromRequest(req);
if (!cookieName) {
return;
}
let id_index = client_ids.indexOf(req.cookies[cookieName]);
let symbols_close = Object.getOwnPropertySymbols(req.client)
let asyncId_close = req.client[symbols_close[1]]
let asyncId_index = instance_ids[id_index].indexOf(asyncId_close)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions system-apps/web-browser-app/webClient/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37122a4

Please sign in to comment.