fix(cabana): allow in-process backend dispatch through CSRF guard
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user