You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: core throttle's response phase overwrites RateLimit fields on an extension's 429 #701
origin/main at bedd85f plus the per-credential quota branch for #572 (feat/auth-credential-quota). Found by reading packages/core/src/policies/throttle.ts and packages/core/src/runtime.ts; not reproduced end to end.
Minimal reproduction
A route that declares both core throttle and the auth bearer quota:
On the third request with one key, auth's authorize() returns a 429 with RateLimit-Policy: "credential";q=2;w=60 and RateLimit: "credential";r=0;t=N. The runtime passes that result through finishPolicies, and throttle's onResponse calls withHeaders, which removes every existing ratelimit/ratelimit-policy field and adds its own "default" policy. The client sees throttle's budget (with remaining capacity) on a refusal caused by the credential budget. Retry-After survives.
Relevant output
withHeaders in packages/core/src/policies/throttle.ts filters by header name before appending. The IETF RateLimit fields are structured-field lists that can carry several named policies, so throttle could append its member to an existing field instead of replacing it.
The auth docs (packages/auth/README.md "Per-credential quota", docs/policies/throttle.md) record this as a current limitation.
Activity
feat(auth): per-credential quota on bearer routes (#572) (#704)
fix(core): name the failing field in validation errors and keep exten…