Encoding not set in HTTP Header when viewing raw files or commits (BB-3501)

Winston Weinert avatarWinston Weinert created an issue

Content encoding isn't specified in HTTP headers when viewing "raw" commits or "raw" files. As a result text often renders incorrectly. Screenshots are attached and here are some links to some affected documents https://bitbucket.org/winstonw/lolwut/raw/5e4250c864e4/README and https://bitbucket.org/winstonw/lolwut/changeset/5e4250c864e4/raw/.

The links should render correctly if your web browser falls back on UTF-8. I found this issue present in Opera 11.61, lynx, and Chromium 17.

Comments (5)

  1. Brodie Rao

    Hi Winston,

    Bitbucket can't know with certainty what the encoding of a file or commit should be. In the case of a commit, there could actually be multiple encodings involved.

    The reason you're seeing garbled output in your browser is because it's falling back to Latin-1.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.