From 95abace8645ff2b711d931ea02e5fe0e00480976 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Tue, 14 Apr 2020 12:04:33 -0700 Subject: [PATCH] Fix 'ExpectationFailedError' errors in MPU test files due to incorrect "Expect" header usage Many MPU tests were setting "Expect: application/json", a presumed accidental misspelling of the "Accept" header. The only valid value for the "Expect" header is "100-continue". Old muskie was using node 0.10. Sometime after 0.10 https://github.com/nodejs/node/pull/4501 changed node behaviour to respond with 417 Expectation Failed if given a bogus "Expect" header. --- test/mpu/abort.test.js | 2 +- test/mpu/auth.test.js | 6 +++--- test/mpu/commit.test.js | 2 +- test/mpu/get.test.js | 2 +- test/mpu/redirect.test.js | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/mpu/abort.test.js b/test/mpu/abort.test.js index 1a7c891..62309dc 100644 --- a/test/mpu/abort.test.js +++ b/test/mpu/abort.test.js @@ -150,7 +150,7 @@ test('abort upload: non-uuid id', function (t) { var options = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' }, path: '/' + this.client.user + '/uploads/f/' + bogus + '/' + action }; diff --git a/test/mpu/auth.test.js b/test/mpu/auth.test.js index e6e2993..32e6dc8 100644 --- a/test/mpu/auth.test.js +++ b/test/mpu/auth.test.js @@ -239,7 +239,7 @@ test('POST /:account/uploads/[0-f]/:id disallowed', function (t) { var opts = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' }, path: self.uploadPath() }; @@ -359,7 +359,7 @@ test('POST /:account/uploads/[0-f]/:id/state disallowed', function (t) { var opts = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' }, path: p }; @@ -664,7 +664,7 @@ test('POST /:account/uploads/[0-f]/:id/:partNum disallowed', function (t) { var opts = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' }, path: self.uploadPath(pn) }; diff --git a/test/mpu/commit.test.js b/test/mpu/commit.test.js index 918dc43..6b8df75 100644 --- a/test/mpu/commit.test.js +++ b/test/mpu/commit.test.js @@ -785,7 +785,7 @@ test('commit upload: non-uuid id', function (t) { var options = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' }, path: '/' + this.client.user + '/uploads/f/' + bogus + '/' + action }; diff --git a/test/mpu/get.test.js b/test/mpu/get.test.js index 91e2a70..54aa220 100644 --- a/test/mpu/get.test.js +++ b/test/mpu/get.test.js @@ -49,7 +49,7 @@ test('get upload: non-uuid id', function (t) { var options = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' } }; diff --git a/test/mpu/redirect.test.js b/test/mpu/redirect.test.js index 2b587ae..f4170fb 100644 --- a/test/mpu/redirect.test.js +++ b/test/mpu/redirect.test.js @@ -134,7 +134,7 @@ test('redirect upload: POST /:account/uploads/:id', function (t) { var options = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' }, path: self.redirectPath() }; @@ -282,7 +282,7 @@ test('redirect upload: POST /:account/uploads/:id/:partNum', function (t) { var options = { headers: { 'content-type': 'application/json', - 'expect': 'application/json' + 'accept': 'application/json' }, path: self.redirectPath(pn) };