lib/api: Add /rest/noauth/health health-check (fixes #8430) (#8585)

This commit is contained in:
Eric P
2022-10-06 21:28:49 +02:00
committed by GitHub
parent c791dba392
commit 7a402409f1
3 changed files with 18 additions and 0 deletions
+7
View File
@@ -74,6 +74,13 @@ func (m *csrfManager) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
if strings.HasPrefix(r.URL.Path, "/rest/noauth") {
// REST calls that don't require authentication also do not
// need a CSRF token.
m.next.ServeHTTP(w, r)
return
}
// Allow requests for anything not under the protected path prefix,
// and set a CSRF cookie if there isn't already a valid one.
if !strings.HasPrefix(r.URL.Path, m.prefix) {