fix: reject cross-origin state-changing requests

This commit is contained in:
Elias Schneider
2026-10-09 20:42:05 +02:00
parent 226648c7b2
commit d31e3e1286
4 changed files with 148 additions and 0 deletions
@@ -90,6 +90,10 @@ func MissingPermission() *Error {
return New(CodeForbidden, http.StatusForbidden, "You don't have permission to perform this action")
}
func CrossOriginRequestForbidden(cause error) *Error {
return Wrap(cause, CodeForbidden, http.StatusForbidden, "Cross-origin requests are not allowed")
}
func TooManyRequests() *Error {
return New(CodeRateLimited, http.StatusTooManyRequests, "Too many requests")
}