Commit 8a6fe290 authored by Francisco Javier López's avatar Francisco Javier López Committed by Nick Thomas

Change content type detection header size to 4k

There is a problem detecting some file types like SVG. Depending
on how the file is built, it will detect the right content type
or not. For example, if the SVG file has a big html comment
(more than 512 bytes) at the beginning of it, when we start
the detection process we'll get the first 512 bytes and based on
that we will set the content type `text/plain`. But this is wrong
because the file is indeed an SVG.
parent ab118e1b
......@@ -6,7 +6,9 @@ import (
)
// Max number of bytes that http.DetectContentType needs to get the content type
const MaxDetectSize = 512
// Fixme: Go back to 512 bytes once https://gitlab.com/gitlab-org/gitlab-workhorse/issues/208
// has been merged
const MaxDetectSize = 4096
// HTTP Headers
const (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment