NCAR / cesm-lens-aws

Examples of analysis of CESM LENS data publicly available on Amazon S3 (us-west-2 region) using xarray and dask
https://doi.org/10.26024/wt24-5j82
BSD 3-Clause "New" or "Revised" License
43 stars 23 forks source link

Content-type on Zarr JSON files in S3 #50

Closed jeffdlb closed 3 years ago

jeffdlb commented 4 years ago

The LENS Zarr JSON metadata files such as .zarray have ContentType=binary/octet-stream instead of application/json. Can we (a) set ContentType correctly for future uploads and (b) fix this for existing objects on S3?

Example:

2264> aws s3api head-object --bucket ncar-cesm-lens --key atm/monthly/cesmLE-20C-FLNS.zarr/FLNS/.zarray
{
    "AcceptRanges": "bytes", 
    "ContentType": "binary/octet-stream", 
    "LastModified": "Fri, 19 Jul 2019 15:13:27 GMT", 
    "ContentLength": 393, 
    "VersionId": "GUtdv6h2i2wKbJdMuzMfzjsXxfDsuJSZ", 
    "ETag": "\"6bb1f5299a15258d4fa193679be5daed\"", 
    "Metadata": {}
}

Ryan Abernathy pointed out (in the Zarr development github) that "Content type is determined by the uploader: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html When writing or copying zarr to s3, you could specify a Content-Type: application/json header for those files."