accept HEAD on / (200)
This commit is contained in:
parent
bace6e7fa4
commit
de50858280
5
main.go
5
main.go
|
@ -78,6 +78,11 @@ func createServeMux() *http.ServeMux {
|
|||
mux.Handle("/music/", http.StripPrefix("/music", view.MusicHandler()))
|
||||
mux.Handle("/uploads/", http.StripPrefix("/uploads", staticHandler(filepath.Join(global.Config.DataDirectory, "uploads"))))
|
||||
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method == http.MethodHead {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
return
|
||||
}
|
||||
|
||||
if r.URL.Path == "/" || r.URL.Path == "/index.html" {
|
||||
err := templates.Pages["index"].Execute(w, nil)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue