Files
plugins/packages/rate-limit/test
chrnx 5e9ca2678b
CI / dco (pull_request) Successful in 3s
CI / build (pull_request) Successful in 13s
CI / runtimes (bun) (pull_request) Failing after 10s
CI / runtimes (edge) (pull_request) Successful in 7s
CI / runtimes (deno) (pull_request) Failing after 8s
test(rate-limit): give peers on different addresses separate budgets on every runtime
The default keyOf buckets callers by ctx.ip. serveDeno and serveBun left ctx.ip empty until
core #116 (merged in core #117), so every caller on those runtimes shared the 'unknown' bucket
and the first one to reach max locked out everybody else.

This drives the plugin's default keyOf over a real socket: one dual-stack listener, client A over
127.0.0.1 and client B over ::1, max: 1. A's second request must be 429 and B's first 200, with two
distinct ctx.ip values. Node's listen() path runs the same test as the control and passes on any
core; on Deno and Bun it passes only on a core that carries #116, and fails on 26.9.0-beta.2.
Hosts without an IPv6 loopback fall back to 127.0.0.1 and 127.0.0.2, which only Linux routes.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-10-10 11:57:43 -05:00
..