fix: fastify uses lowercase headers
All checks were successful
Node.js CI / Lint and Test (push) Successful in 1m12s

This commit is contained in:
2025-07-05 19:38:46 -07:00
parent c87b3439f6
commit 415b53ff03

View File

@ -14,7 +14,7 @@ import type { FastifyRequest } from "fastify";
*/
export const getIpFromRequest = (request: FastifyRequest): string => {
const header
= request.headers["X-Forwarded-For"] ?? request.headers["Cf-Connecting-IP"];
= request.headers["x-forwarded-for"] ?? request.headers["cf-connecting-ip"];
if (typeof header === "string") {
return header;
}