Skip to content

Commit

Permalink
Fix 'ExpectationFailedError' errors in MPU test files due to incorrec…
Browse files Browse the repository at this point in the history
…t "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 nodejs/node#4501
changed node behaviour to respond with 417 Expectation Failed if given
a bogus "Expect" header.
  • Loading branch information
trentm committed Apr 14, 2020
1 parent 3859f68 commit 95abace
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/mpu/abort.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
6 changes: 3 additions & 3 deletions test/mpu/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
Expand Down Expand Up @@ -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
};
Expand Down Expand Up @@ -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)
};
Expand Down
2 changes: 1 addition & 1 deletion test/mpu/commit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
2 changes: 1 addition & 1 deletion test/mpu/get.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
};

Expand Down
4 changes: 2 additions & 2 deletions test/mpu/redirect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};
Expand Down Expand Up @@ -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)
};
Expand Down

0 comments on commit 95abace

Please sign in to comment.