diff --git a/handlers.go b/handlers.go index 356f8c9..4f5c07d 100644 --- a/handlers.go +++ b/handlers.go @@ -119,10 +119,18 @@ func (app *Application) indexHandler(w http.ResponseWriter, r *http.Request) { ".rst": true, } + videoExtensions := map[string]bool{ + ".mkv": true, + } + if textExtensions[ext] { w.Header().Set("Content-Type", "text/plain; charset=utf-8") } + if videoExtensions[ext] { + w.Header().Set("Content-Type", "video/mp4") + } + http.ServeFile(w, r, path) return }