Skip to content

Commit e601f5b

Browse files
committed
return 206 methodResponse only when required (otherwise, other tests are failing)
1 parent e243a6f commit e601f5b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/apiGateway/methods.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ module.exports = {
1010
ResponseModels: {},
1111
StatusCode: 200
1212
},
13-
{
14-
ResponseParameters: {},
15-
ResponseModels: {},
16-
StatusCode: 206
17-
},
1813
{
1914
ResponseParameters: {},
2015
ResponseModels: {},
@@ -28,6 +23,14 @@ module.exports = {
2823
]
2924
}
3025
}
26+
if (http && http.partialContent) {
27+
methodResponse.Properties.MethodResponses.push(
28+
{
29+
ResponseParameters: {},
30+
ResponseModels: {},
31+
StatusCode: 206
32+
});
33+
}
3134

3235
if (http && http.cors) {
3336
let origin = http.cors.origin

lib/package/s3/compileMethodsToS3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
RestApiId: this.provider.getApiGatewayRestApiId()
2323
}
2424
}
25-
25+
event.http.partialContent = true;
2626
_.merge(
2727
template,
2828
this.getS3MethodIntegration(event.http),

0 commit comments

Comments
 (0)