Commit 2b794d4
chore(rate-limit): use req.socket instead of deprecated req.connection (#287)
The fallback IP lookup in \`keyByAuthKeyOrIp\` reached for
\`req.connection.remoteAddress\` when \`req.ip\` was unset. Node has
marked \`request.connection\` deprecated since 13.x as a legacy alias
for \`request.socket\` — same value, different name. Switch to
\`req.socket.remoteAddress\` so the keygen doesn't carry a warning-
class accessor.
Behavior is identical; the existing unit tests (which inject a
plain \`{ ip }\` object) still pass without modification because
they never reach the fallback branch.
760 tests still pass.
Co-authored-by: Aaron K. Clark <akclark@thenetwerk.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fd1a7c4 commit 2b794d4
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
0 commit comments