refactor: fix incorrect logic introduced in previous commits and improve error handling

This commit is contained in:
yusing
2025-11-07 15:48:38 +08:00
parent d33ff2192a
commit e9ac3cd1a9
14 changed files with 99 additions and 50 deletions

View File

@@ -38,6 +38,12 @@ func (w *Watcher) writeLoadingPage(rw http.ResponseWriter) error {
data.LoadingPageCSSPath = idlewatcher.LoadingPageCSSPath
data.LoadingPageJSPath = idlewatcher.LoadingPageJSPath
data.WakeEventsPath = idlewatcher.WakeEventsPath
rw.Header().Set("Content-Type", "text/html; charset=utf-8")
rw.Header().Set("Cache-Control", "no-cache")
rw.Header().Add("Cache-Control", "no-store")
rw.Header().Add("Cache-Control", "must-revalidate")
rw.Header().Add("Connection", "close")
err := loadingPageTmpl.Execute(rw, data)
return err
}