mirror of
https://github.com/Luzifer/password.git
synced 2024-11-08 17:30:10 +00:00
Fix: Serve needs to provide proper mime types
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
bb3b175c66
commit
78cab7a245
1 changed files with 6 additions and 1 deletions
|
@ -3,12 +3,15 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"mime"
|
||||
"net/http"
|
||||
"path"
|
||||
"strconv"
|
||||
|
||||
pwd "github.com/Luzifer/password/lib"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
pwd "github.com/Luzifer/password/lib"
|
||||
)
|
||||
|
||||
func getCmdServe() *cobra.Command {
|
||||
|
@ -76,5 +79,7 @@ func handleAssets(res http.ResponseWriter, r *http.Request) {
|
|||
http.Error(res, "Unable to load interface", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
res.Header().Set("Content-Type", mime.TypeByExtension(path.Base(r.URL.Path)))
|
||||
res.Write(buf)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue