Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scaleway_object resource not setting the HTTP Content-Type header correctly #2898

Open
yfodil opened this issue Feb 4, 2025 · 1 comment
Assignees
Labels
bug object Object storage issues, bugs and feature requests priority:high New features

Comments

@yfodil
Copy link
Contributor

yfodil commented Feb 4, 2025

Description

Currently, the scaleway_object resource only accepts a generic metadata map. When trying to set the HTML content type (for example, to render an HTML page in a bucket website), using:

metadata = {
  content-type = "text/html"
}

results in the provider sending x-amz-meta-content-type: text/html instead of setting the actual HTTP Content-Type header. As a result, browsers receive a default Content-Type (such as application/octet-stream), which causes the HTML file to be downloaded rather than rendered.

In contrast, when using the Scaleway Console, adding a metadata key content-type with the value text/html properly sets the HTTP header on the object.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Affected Resource(s)

  • scaleway_object

Terraform Configuration Files

resource "scaleway_object" "main" {
  bucket     = scaleway_object_bucket.main.name
  key        = "index.html"
  file       = "index.html"
  visibility = "public-read"
  metadata = {
    content-type = "text/html"
  }
}
@yfodil yfodil added bug object Object storage issues, bugs and feature requests priority:high New features labels Feb 4, 2025
@vjarry
Copy link

vjarry commented Feb 4, 2025

Hi ! Thank you for this issue.

As a complement, there is no need to set the metadata content-type = text/html via the console if the index.html file has been put via the console. It is automatically rendered and not downloaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug object Object storage issues, bugs and feature requests priority:high New features
Projects
None yet
Development

No branches or pull requests

3 participants