gitlab-org--gitlab-foss/app/views/projects/diffs
Stan Hu 0fdfd2dd6e Fix Error 500 when viewing a blob with binary characters after the 1024-byte mark
Here was the problem:

1. When determining whether a given blob is viewable text, gitlab_git reads the first 1024 bytes and checks with Linguist whether it is a text or binary file.
2. If the blob is text, GitLab will attempt to display it.
3. However, if the text has binary characters after the first 1024 bytes, then GitLab will attempt to load the entire contents, but the encoding will be ASCII-8BIT since there are binary characters.
4. The Error 500 results when GitLab attempts to display a mix UTF-8 and ASCII-8BIT.

To fix this, we load as much data as we are willing to display so that the detection will work properly. Requires
an update to gitlab_git: gitlab-org/gitlab_git!86

Closes #13826
2016-06-12 07:36:25 -07:00
..
_diffs.html.haml Fix Error 500 when viewing a blob with binary characters after the 1024-byte mark 2016-06-12 07:36:25 -07:00
_file.html.haml Fix Error 500 when viewing a blob with binary characters after the 1024-byte mark 2016-06-12 07:36:25 -07:00
_image.html.haml Fix creation of merge requests for orphaned branches 2016-04-04 04:51:05 -07:00
_line.html.haml Use @diff_notes_disabled instead of @comments_allowed 2016-05-13 17:31:58 -05:00
_match_line.html.haml Use consistent markup and styling for highlighting across blobs, diffs, blame and snippets 2016-01-21 14:23:53 +01:00
_match_line_parallel.html.haml Use consistent markup and styling for highlighting across blobs, diffs, blame and snippets 2016-01-21 14:23:53 +01:00
_parallel_view.html.haml Use @diff_notes_disabled instead of @comments_allowed 2016-05-13 17:31:58 -05:00
_stats.html.haml Avoid unnecessary usage of local vars 2015-10-01 15:51:28 +02:00
_text_file.html.haml Use @diff_notes_disabled instead of @comments_allowed 2016-05-13 17:31:58 -05:00
_warning.html.haml Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00