cmd/htpacker: workaround for SVG files without XML prolog

If a .svg file doesn't have a “<?xml…” prolog, then it would be detected as plain
text. Allow extension-based override of the content-type in this case.
This commit is contained in:
Laurence Withers 2019-06-25 15:31:49 +01:00
parent 8528a31d54
commit 0883b0b405
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,8 @@ func filesFromListR(prefix, arg string, ftp packer.FilesToPack) error {
ctype = "application/javascript"
case ".json":
ctype = "application/json"
case ".svg":
ctype = "image/svg+xml"
}
case strings.HasPrefix(ctype, "text/xml"):