aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.59k stars 1.55k forks source link

fix: do not serialize empty lists in ec2 #4639

Closed kuhe closed 4 months ago

kuhe commented 4 months ago
kuhe commented 4 months ago

testing:

process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE = 1;

const AWS = require("../../lib/aws");

const ec2 = new AWS.EC2({
    region: "us-west-2",
});

const request = ec2.describeFleets({
    Filters: []
});

request.promise();

console.log(request.httpRequest.body);

this logs Action=DescribeFleets&Version=2016-11-15 with the fix, as is intended.

this logs Action=DescribeFleets&Filter=&Version=2016-11-15 without the fix, and the request fails.