Skip to content

Commit 95abace

Browse files
committed
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 nodejs/node#4501 changed node behaviour to respond with 417 Expectation Failed if given a bogus "Expect" header.
1 parent 3859f68 commit 95abace

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

test/mpu/abort.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ test('abort upload: non-uuid id', function (t) {
150150
var options = {
151151
headers: {
152152
'content-type': 'application/json',
153-
'expect': 'application/json'
153+
'accept': 'application/json'
154154
},
155155
path: '/' + this.client.user + '/uploads/f/' + bogus + '/' + action
156156
};

test/mpu/auth.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ test('POST /:account/uploads/[0-f]/:id disallowed', function (t) {
239239
var opts = {
240240
headers: {
241241
'content-type': 'application/json',
242-
'expect': 'application/json'
242+
'accept': 'application/json'
243243
},
244244
path: self.uploadPath()
245245
};
@@ -359,7 +359,7 @@ test('POST /:account/uploads/[0-f]/:id/state disallowed', function (t) {
359359
var opts = {
360360
headers: {
361361
'content-type': 'application/json',
362-
'expect': 'application/json'
362+
'accept': 'application/json'
363363
},
364364
path: p
365365
};
@@ -664,7 +664,7 @@ test('POST /:account/uploads/[0-f]/:id/:partNum disallowed', function (t) {
664664
var opts = {
665665
headers: {
666666
'content-type': 'application/json',
667-
'expect': 'application/json'
667+
'accept': 'application/json'
668668
},
669669
path: self.uploadPath(pn)
670670
};

test/mpu/commit.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ test('commit upload: non-uuid id', function (t) {
785785
var options = {
786786
headers: {
787787
'content-type': 'application/json',
788-
'expect': 'application/json'
788+
'accept': 'application/json'
789789
},
790790
path: '/' + this.client.user + '/uploads/f/' + bogus + '/' + action
791791
};

test/mpu/get.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test('get upload: non-uuid id', function (t) {
4949
var options = {
5050
headers: {
5151
'content-type': 'application/json',
52-
'expect': 'application/json'
52+
'accept': 'application/json'
5353
}
5454
};
5555

test/mpu/redirect.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ test('redirect upload: POST /:account/uploads/:id', function (t) {
134134
var options = {
135135
headers: {
136136
'content-type': 'application/json',
137-
'expect': 'application/json'
137+
'accept': 'application/json'
138138
},
139139
path: self.redirectPath()
140140
};
@@ -282,7 +282,7 @@ test('redirect upload: POST /:account/uploads/:id/:partNum', function (t) {
282282
var options = {
283283
headers: {
284284
'content-type': 'application/json',
285-
'expect': 'application/json'
285+
'accept': 'application/json'
286286
},
287287
path: self.redirectPath(pn)
288288
};

0 commit comments

Comments
 (0)