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

Content-type header for JSON incorrect? #34

Closed
Jos512 opened this issue Jul 30, 2018 · 2 comments
Closed

Content-type header for JSON incorrect? #34

Jos512 opened this issue Jul 30, 2018 · 2 comments

Comments

@Jos512
Copy link
Sponsor

Jos512 commented Jul 30, 2018

I see that here in the code s3deploy sets the content-type header.

But for JSON files, the header becomes application/octet-stream in my bucket, which seems to be the basic header for arbitrary binary data from what I know. The proper header would be application/json for JSON files.

For me this is relevant because now Firefox and Chrome download the JSON file from my website each time, instead of allowing people to see the file's content. I attribute that to the inproper header.

@bep
Copy link
Owner

bep commented Jul 30, 2018

You can set the MIME type in your config.

@bep bep closed this as completed Jul 30, 2018
@Jos512
Copy link
Sponsor Author

Jos512 commented Jul 31, 2018

How? I used the approach below to set the content type, but that didn't have an effect. That made me think this option is not supported.

routes:
    - route: "^.+\\.(html|xml|js|css)$"
      gzip: true
    - route: "^.+\\.(png|jpg)$"
      gzip: false
    - route: "^.+\\.json$"
      gzip: true
      content-type: "application/json; charset=utf-8"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants