🔀 Merge branch 'RicardoE105-feature/aws-s3'

This commit is contained in:
Jan Oberhauser 2020-04-20 21:29:36 +02:00
commit 059d28b779

View file

@ -145,17 +145,14 @@ export class AwsS3 implements INodeType {
}, },
} }
}; };
let data = '';
// For some reasons does AWS not allow to supply "us-east-1" if you want to // if credentials has the S3 defaul region (us-east-1) the body (XML) does not have to be sent.
// create it there it has to be empty?!?!
if (credentials!.region !== 'us-east-1') { if (credentials!.region !== 'us-east-1') {
// @ts-ignore // @ts-ignore
body.CreateBucketConfiguration.LocationConstraint = [credentials!.region]; body.CreateBucketConfiguration.LocationConstraint = [credentials!.region];
const builder = new Builder();
data = builder.buildObject(body);
} }
const builder = new Builder();
const data = builder.buildObject(body);
responseData = await awsApiRequestSOAP.call(this, `${name}.s3`, 'PUT', '', data, qs, headers); responseData = await awsApiRequestSOAP.call(this, `${name}.s3`, 'PUT', '', data, qs, headers);
returnData.push({ success: true }); returnData.push({ success: true });