Setting content-type for CSS file when uploading to cloud storage (Tigris)

Hi guys,

so, I’m trying to upload css file to Tigris cloud storage but the file content type is always saved as application/octet-stream even if I set content_type: "text/css" when uploading file. Do you have any idea on how to handle this properly?

defp upload_css_to_cloud(source, dest) do
    bucket()
    |> ExAws.S3.put_object(dest, File.read!(source), content_type: "text/css")
    |> ExAws.request()
  end

Both Claude and ChatGPT 4o seem to agree on:

defp upload_css_to_cloud(source, dest) do
  bucket()
  |> ExAws.S3.put_object(
       dest,
       File.read!(source),
       headers: [{"Content-Type", "text/css"}]
     )
  |> ExAws.request()
end

Curious if that works.

I doesn’t unfortunately, both Claude and ChatGPT offered multiple solutions, but no matter which one I try, CSS file always ends up having application/octet-stream as a content type.

Can you try to see what Tigris returns?

iex> ExAws.S3.head_object(bucket(), key)
…> |> ExAws.request!()
…> |> Map.fetch!(:headers)
…> |> Map.fetch!(“content-type”)
“text/css” ?