-
-
Notifications
You must be signed in to change notification settings - Fork 70
Description
While trying to increase the rate limit by using the CACHET_API_RATE_LIMIT env variable and checking the X-RateLimit-Limit header, I noticed it didn't set and apply the configured value nor the default value of 300.
Instead, it's always 60.
Diving into the code, I found out the following.
The middleware set for the api routes are cachet:api and throttle:cachet-api (in CachetCoreServiceProvider).
throttle:cachet-api seems to be correct and I see the config setting being applied.
cachet:api on the other hand configures middleware according to the config cachet.api_middleware. That one is 'api'.
In AppServiceProvider a RateLimiter is set for the name 'api'. Not sure how that ends up in that middleware group, but it does.
That RateLimiter is set to 60 attempts per minute and that's what's limiting it and returned in the headers.