diff options
author | Julien Dessaux | 2025-01-22 00:46:49 +0100 |
---|---|---|
committer | Julien Dessaux | 2025-01-22 00:46:49 +0100 |
commit | 09885ef1e4b7610d05377596f02d08c5079c0434 (patch) | |
tree | 9c8322ea718f1eb721a4c685cb95386fa84bb797 /pkg/webui/index.go | |
parent | chore(webui): refactor login and session middleware handling (diff) | |
download | tfstated-09885ef1e4b7610d05377596f02d08c5079c0434.tar.gz tfstated-09885ef1e4b7610d05377596f02d08c5079c0434.tar.bz2 tfstated-09885ef1e4b7610d05377596f02d08c5079c0434.zip |
Diffstat (limited to 'pkg/webui/index.go')
-rw-r--r-- | pkg/webui/index.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/webui/index.go b/pkg/webui/index.go index 9c81729..3a52fc1 100644 --- a/pkg/webui/index.go +++ b/pkg/webui/index.go @@ -1,16 +1,16 @@ package webui import ( - "html/template" + "fmt" "net/http" ) -var indexTemplates = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/index.html")) - func handleIndexGET() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Cache-Control", "no-store, no-cache") - - render(w, indexTemplates, http.StatusOK, nil) + if r.URL.Path == "/" { + http.Redirect(w, r, "/states", http.StatusFound) + } else { + errorResponse(w, http.StatusNotFound, fmt.Errorf("Page not found")) + } }) } |