If I upload this with the CacheControl option, upload works fine.
But when I load it on the client side I get a CORS error.
If I remove CachControl, obviously the CORS error doesn't come up.
My Bucket has CORS-Policy like this
My Upload code is following like
import { FileUpload } from "../types/scalars/Upload.scalar";
new S3.ManagedUpload({
params: {
ACL: "public-read",
Bucket: process.env.AWS_BUCKETNAME || "",
Body: upload.createReadStream(),
Key: filename || upload.filename,
CacheControl: "max-age=604800,public,immutable",
},
// tags,
}).promise();
My S3 CORS Policy is following like
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET",
"POST"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]