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:
parent
8528a31d54
commit
0883b0b405
|
@ -143,6 +143,8 @@ func filesFromListR(prefix, arg string, ftp packer.FilesToPack) error {
|
||||||
ctype = "application/javascript"
|
ctype = "application/javascript"
|
||||||
case ".json":
|
case ".json":
|
||||||
ctype = "application/json"
|
ctype = "application/json"
|
||||||
|
case ".svg":
|
||||||
|
ctype = "image/svg+xml"
|
||||||
}
|
}
|
||||||
|
|
||||||
case strings.HasPrefix(ctype, "text/xml"):
|
case strings.HasPrefix(ctype, "text/xml"):
|
||||||
|
|
Loading…
Reference in New Issue