More types
parent
6ae09962ad
commit
c6109e23af
24
main.go
24
main.go
|
|
@ -207,8 +207,6 @@ func setContentTypeIfMedia(w http.ResponseWriter, r *http.Request) {
|
|||
switch strings.ToLower(path.Ext(r.URL.Path)) {
|
||||
case ".mp4":
|
||||
w.Header().Set("Content-Type", "video/mp4")
|
||||
case ".webm":
|
||||
w.Header().Set("Content-Type", "video/webm")
|
||||
case ".mkv":
|
||||
w.Header().Set("Content-Type", "video/x-matroska")
|
||||
case ".mp3":
|
||||
|
|
@ -225,5 +223,27 @@ func setContentTypeIfMedia(w http.ResponseWriter, r *http.Request) {
|
|||
w.Header().Set("Content-Type", "image/x-icon")
|
||||
case ".svg":
|
||||
w.Header().Set("Content-Type", "image/svg+xml")
|
||||
case ".css":
|
||||
w.Header().Set("Content-Type", "text/css")
|
||||
case ".js":
|
||||
w.Header().Set("Content-Type", "text/javascript")
|
||||
case ".json":
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
case ".html", ".htm":
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
case ".pdf":
|
||||
w.Header().Set("Content-Type", "application/pdf")
|
||||
case ".webm":
|
||||
w.Header().Set("Content-Type", "video/webm")
|
||||
case ".weba":
|
||||
w.Header().Set("Content-Type", "audio/webm")
|
||||
case ".webp":
|
||||
w.Header().Set("Content-Type", "image/webp")
|
||||
case ".zip":
|
||||
w.Header().Set("Content-Type", "application/zip")
|
||||
case ".7z":
|
||||
w.Header().Set("Content-Type", "application/x-7z-compressed")
|
||||
case ".tar":
|
||||
w.Header().Set("Content-Type", "application/x-tar")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue