Update handlers

This commit is contained in:
Milan Nikolic
2025-06-13 20:36:55 +02:00
parent e5ee1a2049
commit 933b5eef22
5 changed files with 22 additions and 12 deletions

View File

@@ -32,12 +32,13 @@ func (h *HTML) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" && r.Method != "HEAD" {
msg := fmt.Sprintf("405 Method Not Allowed (%s)", r.Method)
http.Error(w, msg, http.StatusMethodNotAllowed)
return
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(http.StatusOK)
w.Write(h.Template)
_, _ = w.Write(h.Template)
}
var html = `<html>