Skip to content

Commit

Permalink
add svg suport
Browse files Browse the repository at this point in the history
  • Loading branch information
nobonobo committed Apr 14, 2016
1 parent 690ae2d commit 4da3f44
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server.go
Expand Up @@ -89,10 +89,13 @@ func (h *rootHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}

func detectContentType(path string, data []byte) string {
if strings.HasSuffix(path, ".css") {
switch {
case strings.HasSuffix(path, ".css"):
return "text/css"
} else if strings.HasSuffix(path, ".js") {
case strings.HasSuffix(path, ".js"):
return "application/javascript"
case strings.HasSuffix(path, ".svg"):
return "image/svg+xml"
}
return http.DetectContentType(data)
}
Expand Down

0 comments on commit 4da3f44

Please sign in to comment.