generated from nhcarrigan/template
This commit is contained in:
@@ -14,7 +14,7 @@ import type { FastifyRequest } from "fastify";
|
|||||||
*/
|
*/
|
||||||
export const getIpFromRequest = (request: FastifyRequest): string => {
|
export const getIpFromRequest = (request: FastifyRequest): string => {
|
||||||
const header
|
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") {
|
if (typeof header === "string") {
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user