fup: add additional mimetypes to pretty page
This commit is contained in:
parent
01fb49549b
commit
ba95046e84
2 changed files with 5 additions and 2 deletions
|
@ -83,7 +83,10 @@ type Application struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func DefaultUseDirectDownload(fileExtension, mimeType string) bool {
|
func DefaultUseDirectDownload(fileExtension, mimeType string) bool {
|
||||||
// Only use the pretty page for text/*.
|
switch mimeType {
|
||||||
|
case "application/json", "application/xml", "application/xhtml+xml", "application/x-csh", "application/x-sh":
|
||||||
|
return false
|
||||||
|
}
|
||||||
return !strings.HasPrefix(mimeType, "text/")
|
return !strings.HasPrefix(mimeType, "text/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ func renderAsCode(mimeType string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
switch mimeType {
|
switch mimeType {
|
||||||
case "application/json", "application/xml":
|
case "application/json", "application/xml", "application/xhtml+xml", "application/x-csh", "application/x-sh":
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue