From d41903830b56f30341a0ccc7f7c1abd8881c5386 Mon Sep 17 00:00:00 2001 From: Brandon McFarlin Date: Sun, 23 Feb 2020 17:33:56 -0500 Subject: [PATCH] security updates --- lib/nestcam.js | 6 +++--- lib/streamer.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nestcam.js b/lib/nestcam.js index 8a42ddd..05ba0ab 100644 --- a/lib/nestcam.js +++ b/lib/nestcam.js @@ -216,7 +216,7 @@ class NestCam { if (self.enabled) { let sessionID = uuid.unparse(request['sessionID']); let streamer = new NexusStreamer(self.nexusTalkHost, self.uuid, self.api.accessToken, self.ffmpegCodec, self.log); - self.sessions[sessionID] = streamer; + self.sessions[`${sessionID}`] = streamer; streamer.prepareStream(request, callback); } } @@ -229,7 +229,7 @@ class NestCam { if (sessionID) { let sessionIdentifier = uuid.unparse(sessionID); - let streamer = self.sessions[sessionIdentifier]; + let streamer = self.sessions[`${sessionIdentifier}`]; if (!streamer) { return; } @@ -238,7 +238,7 @@ class NestCam { streamer.startPlaybackWithRequest(request); } else if (requestType === 'stop') { streamer.stopPlayback(); - delete self.sessions[sessionIdentifier]; + delete self.sessions[`${sessionIdentifier}`]; } } } diff --git a/lib/streamer.js b/lib/streamer.js index 3c1de47..f3426ae 100644 --- a/lib/streamer.js +++ b/lib/streamer.js @@ -240,7 +240,7 @@ class NexusStreamer extends EventEmitter { } for (let i = 0; i < packet.channels.length; i++) { - var stream = packet.channels[i]; + var stream = packet.channels[`${i}`]; if (stream.codec_type === CodecType.H264) { self.videoChannelID = stream.channel_id; } else if (stream.codec_type === CodecType.AAC || stream.codec_type === CodecType.OPUS) {