fix: SetupRequired middleware exempts health, static, and API routes (closes #108)

This commit is contained in:
clawbot 2026-02-20 03:33:34 -08:00
parent efd3500dac
commit 6cfd5023f9

View File

@ -411,8 +411,14 @@ func (m *Middleware) SetupRequired() func(http.Handler) http.Handler {
} }
if setupRequired { if setupRequired {
// Allow access to setup page path := request.URL.Path
if request.URL.Path == "/setup" {
// Allow access to setup page, health endpoint, static
// assets, and API routes even before setup is complete.
if path == "/setup" ||
path == "/health" ||
strings.HasPrefix(path, "/s/") ||
strings.HasPrefix(path, "/api/") {
next.ServeHTTP(writer, request) next.ServeHTTP(writer, request)
return return