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 {
|
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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user