From d73174d32be9985954ce18cc8659e2752d9913de Mon Sep 17 00:00:00 2001 From: Mofizur Rahman Date: Tue, 26 Apr 2022 17:21:49 -0400 Subject: [PATCH] patch response to 204 --- lib/archiving.js | 2 +- spec/opentok_spec.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/archiving.js b/lib/archiving.js index 4499d972..f9a0280b 100644 --- a/lib/archiving.js +++ b/lib/archiving.js @@ -413,7 +413,7 @@ function patchArchive(config, archiveId, options, callback) { '/archive/' + encodeURIComponent(archiveId) + '/streams', options, function patchArchiveCallback(err, response, body) { - if (err || response.statusCode !== 200) { + if (err || response.statusCode !== 204) { if (response && response.statusCode === 400) { callback(new errors.ArgumentError('Invalid request: ' + JSON.stringify(body))); } diff --git a/spec/opentok_spec.js b/spec/opentok_spec.js index 6129af6b..39547be2 100644 --- a/spec/opentok_spec.js +++ b/spec/opentok_spec.js @@ -475,7 +475,7 @@ describe('Archiving', function () { it('should patch an archive with addStream', function (done) { nock(archiveHostUrl) .patch(archivePatchResource, { addStream: mockStreamId, hasAudio: true, hasVideo: true }) - .reply(200); + .reply(204); opentok.addArchiveStream(mockArchiveId, mockStreamId, { hasAudio: true, hasVideo: true @@ -488,7 +488,7 @@ describe('Archiving', function () { it('should patch an archive with just addStream', function (done) { nock(archiveHostUrl) .patch(archivePatchResource, { addStream: mockStreamId, hasAudio: true, hasVideo: true }) - .reply(200); + .reply(204); opentok.addArchiveStream(mockArchiveId, mockStreamId, function (err) { expect(err).toBeNull(); @@ -499,7 +499,7 @@ describe('Archiving', function () { it('should patch an archive with removeStream', function (done) { nock(archiveHostUrl) .patch(archivePatchResource, { removeStream: mockStreamId }) - .reply(200); + .reply(204); opentok.removeArchiveStream(mockArchiveId, mockStreamId, function (err) { expect(err).toBeNull();