mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-10 11:49:05 +02:00
fix: reject cross-origin state-changing requests
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user