summaryrefslogtreecommitdiff
path: root/src/edit/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/edit/util.go')
-rw-r--r--src/edit/util.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/edit/util.go b/src/edit/util.go
index 5835b10..b1950ed 100644
--- a/src/edit/util.go
+++ b/src/edit/util.go
@@ -33,15 +33,16 @@ func getctype(name string, content []byte) string {
if ctype == "" {
ctype = http.DetectContentType(content)
}
- return ctype
-}
-func istext(ctype string) bool {
i := strings.Index(ctype, ";")
if i == -1 {
i = len(ctype)
}
ctype = strings.TrimSpace(strings.ToLower(ctype[0:i]))
+ return ctype
+}
+
+func istext(ctype string) bool {
return strings.HasPrefix(ctype, "text/") || strings.HasSuffix(ctype, "+xml")
}