GoogleCloudPlatform / GoogleCloudPlatform/gsutil

Wrong Content-Type header for UTF-8 files

Open
#334 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

I have an UTF-8 encoded Javascript file, which I want to serve as a static asset from a GCS bucket. The problem is that the file always has `content-type:application/javascript` while it should be `content-type:application/javascript; charset=utf-8`.

I've tried using `use_magicfile = True` but that doesn't help either because the file command is called with `--mime-type` instead of the `--mime` argument which would include the charset http://linux.die.net/man/1/file.

The fix would be as easy as changing the argument here:

https://github.com/GoogleCloudPlatform/gsutil/blob/34571ffcdb82383e1a9144f9744fc8b5b97b5fdb/gslib/copy_helper.py#L1317

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.