add support for serving svg files

This commit is contained in:
root
2020-08-22 17:09:41 +00:00
parent 74dab856c4
commit d1d46cee71

View File

@@ -237,6 +237,8 @@ func (e mainEnv) setupRouter() *httprouter.Router {
w.Header().Set("Content-Type", "text/css")
} else if strings.HasSuffix(r.URL.Path, ".js") {
w.Header().Set("Content-Type", "text/javascript")
} else if strings.HasSuffix(r.URL.Path, ".svg") {
w.Header().Set("Content-Type", "image/svg+xml")
}
w.WriteHeader(200)
w.Write([]byte(data))