I want to get a pre-signed URL for my S3 bucket for a PUT request like this (in node.js)
AWS.config.update({
accessKeyId: s3Config.accessKeyId,
secretAccessKey: s3Config.secretAccessKey,
region: s3Config.region,
signatureVersion: 'v4'
});
var s3bucket = new AWS.S3({params: {Bucket: s3Config.bucket,Key:'/content'}});
s3Config.preSignedURL = s3bucket.getSignedUrl('putObject',{ACL:s3Config.acl})
as a result i get
https://[BUCKET].s3.[REGION].amazonaws.com/[KEY]?[presignedURLStuff]
This URL is according to Amazon wrong. The URL has to be in the format http://*.s3.amazonaws.com/*. I also get the Error net::ERR_INSECURE_RESPONSE from the pre-flight. What do I have to do that the function constructs the right URL. Removing the region from the URL leads to 400 Bad Request. Pre-flight OPTIONS works then.