You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-11-25 15:42:01 +02:00
added the triggered rate limit rule in the error log details
This commit is contained in:
@@ -704,3 +704,13 @@ func (c RateLimitRule) Validate() error {
|
||||
func (c RateLimitRule) DurationTime() time.Duration {
|
||||
return time.Duration(c.Duration) * time.Second
|
||||
}
|
||||
|
||||
// String returns a string representation of the rule.
|
||||
func (c RateLimitRule) String() string {
|
||||
raw, err := json.Marshal(c)
|
||||
if err != nil {
|
||||
return c.Label // extremely rare case
|
||||
}
|
||||
|
||||
return string(raw)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user