fix(cabana): allow in-process backend dispatch through CSRF guard

This commit is contained in:
Jakub Zych
2026-11-27 14:36:34 +01:00
parent 9dffab9af7
commit e26aeceb2b
2 changed files with 30 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ package cabana
import (
"net/http"
"strings"
"git.golem15.com/golem15/summercms/modules/bouncer"
)
const (
@@ -34,6 +36,9 @@ func csrfSafe(r *http.Request) bool {
case http.MethodGet, http.MethodHead, http.MethodOptions:
return true
}
if _, ok := bouncer.Dispatched(r.Context(), "backend"); ok {
return true
}
if bearerToken(r) != "" {
return true
}