I’m looking into adding some extra HTTP headers to the files we host on S3, like for example X-Content-Type-Options: nosniff.
I had the vague notion this was possible using S3 meta data, but Amazon transforms these names and returns them prefixed with ‘x-amz-meta-’, for this example I get ‘x-amz-meta-x-content-type-options:“nosniff”’.
Does anyone know if this is possible at all? We’re using a S3 wrapper based on boto3 but I don’t see it in the boto docs, headers are either direct attributes like cache control or the generic non-http meta.
We use this bucket as a CloudFront origin so maybe something could be done here? Alternately we could reverse-proxy the bucket through our own server and add the headers but it seems a bit silly to put a server inside the serverless route.
Related discussions:
- How to reduce CloudFront cost with already pretty good cache hit ratio
- Processing billions of tiny files in an un-partitioned S3
- Do you create backups of your S3 Buckets?
- New AWS Organizations member account blocked from CloudFront (“account must be verified”), support case open for 2 weeks with no reply. Normal?
- Amplify vs CloudFront + SE for frontend