fup: add additional mimetypes to pretty page

This commit is contained in:
Luke Granger-Brown 2021-03-22 01:09:00 +00:00
parent 01fb49549b
commit ba95046e84
2 changed files with 5 additions and 2 deletions

View file

@ -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/")
} }

View file

@ -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