Skip to content

Commit aafdf66

Browse files
Disable rate limiting on relay endpoint (#745)
## Summary - Relay calls from the SDK don't attach `api_key` or `app_name`, so they fall back to IP-based rate limiting at 5 RPS default - Batch track uploads (e.g. 22 tracks via `Promise.all`) exceed this limit, causing `EntityManagerClient.manageEntity` to fail with "API Rate Limit Exceeded" - Skips rate limiting on `/relay` paths until the SDK properly identifies itself on relay calls ## Test plan - [ ] Verify batch track upload (20+ tracks) no longer hits rate limit errors - [ ] Verify rate limiting still works on `/v1` API endpoints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 70dbc44 commit aafdf66

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

api/rate_limit_middleware.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ type RateLimitMiddleware struct {
109109
// Middleware returns the Fiber handler. Pass apiServer to resolve identifier from Bearer or Basic Auth signer first; if nil or no signer, falls back to api_key/app_name query params.
110110
func (rlm *RateLimitMiddleware) Middleware(apiServer *ApiServer) fiber.Handler {
111111
return func(c *fiber.Ctx) error {
112+
// Skip rate limiting for relay endpoints
113+
if strings.HasPrefix(c.Path(), "/relay") {
114+
return c.Next()
115+
}
116+
112117
var identifier string
113118
if apiServer != nil {
114119
signer, err := apiServer.getApiSigner(c)

0 commit comments

Comments
 (0)