fix: SetupRequired middleware exempts health, static, and API routes (closes #108)
This commit is contained in:
parent
efd3500dac
commit
6cfd5023f9
@ -411,8 +411,14 @@ func (m *Middleware) SetupRequired() func(http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
if setupRequired {
|
||||
// Allow access to setup page
|
||||
if request.URL.Path == "/setup" {
|
||||
path := request.URL.Path
|
||||
|
||||
// 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)
|
||||
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user