Changeset c88783e in Klonkt for src/routes/posts.js

Timestamp:
06/11/2026 12:08:23 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
b5bae24
Parents:
353c39c
Message:

fix: rate limiter crash behind Cloudflare/Caddy (req.ip with port)

express-rate-limit v7 validates req.ip and throws ERR_ERL_INVALID_IP_ADDRESS
when the IP contains a port (e.g. "104.23.170.162:11046" via the proxy chain).
Uncaught async -> process crashes -> pm2 restart loop -> EADDRINUSE on :3000.

Fix: custom keyGenerator (clientKey) that strips a trailing IPv4 port + falls
back to the socket, and validate:{ip:false} on both limiters so a non-standard
IP format can never crash the process again.

Co-Authored-By: Claude Opus 4.8 <noreply@…>

(No files)

Note: See TracChangeset for help on using the changeset viewer.