Set content type on response for static file serve

This commit is contained in:
Bel LaPointe
2020-07-23 23:29:34 -06:00
parent bbdd4919ba
commit ed3006d359
2 changed files with 33 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ package view
import (
"local/dndex/config"
"local/dndex/storage"
"local/simpleserve/simpleserve"
"net/http"
"path"
"strings"
@@ -14,6 +15,7 @@ func files(_ storage.Graph, w http.ResponseWriter, r *http.Request) error {
http.NotFound(w, r)
return nil
}
simpleserve.SetContentTypeIfMedia(w, r)
switch r.Method {
case http.MethodGet:
return filesGet(w, r)