Skip to content

Commit

Permalink
Merge pull request #270 from opentok/patch/269
Browse files Browse the repository at this point in the history
patch response to 204
  • Loading branch information
moficodes authored Apr 26, 2022
2 parents 57d49a7 + d73174d commit 9ad595c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/archiving.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand Down
6 changes: 3 additions & 3 deletions spec/opentok_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 9ad595c

Please sign in to comment.