1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-12 09:43:31 +00:00

refactor: use constants for AppEnv values (#1098)

This commit is contained in:
Alessandro (Ale) Segala
2025-11-16 09:25:06 -08:00
committed by GitHub
parent 29a1d3b778
commit a54b867105
5 changed files with 24 additions and 12 deletions

View File

@@ -29,7 +29,7 @@ func (m *RateLimitMiddleware) Add(limit rate.Limit, burst int) gin.HandlerFunc {
// Skip rate limiting for localhost and test environment
// If the client ip is localhost the request comes from the frontend
if ip == "" || ip == "127.0.0.1" || ip == "::1" || common.EnvConfig.AppEnv == "test" {
if ip == "" || ip == "127.0.0.1" || ip == "::1" || common.EnvConfig.AppEnv.IsTest() {
c.Next()
return
}