I am new to aws-sdk and I want to sign Cache-Control, Content-Type and x-amz-acl headers for presigned url. Is it possible to do with s3-request-presigner? I can't find any example.
var command = new PutObjectCommand({
Bucket: 'mybucket',
Key: 'file.txt',
ACL: 'public-read',
CacheControl: 'public, max-age=1000',
ContentType: 'text/plain',
});
var signedUrl = await getSignedUrl(s3Client, command, {
expiresIn: 3600,
signableHeaders:
new Set(['Cache-Control', 'Content-Type', 'x-amz-acl'])
});
The resulting url contains this: X-Amz-SignedHeaders=host. That is, my headers don't get signed. What do I have to do?
Also, can I restrain the size of the upload with something like content-length-range and sign it as well?