From d62e1c3703ef92a36ba89ce7087ed27d75f116c8 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Mon, 29 Jan 2024 16:51:38 +0700 Subject: [PATCH] Bump Cloudflare IP priority --- backend/src/server/plugins/ip.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/server/plugins/ip.ts b/backend/src/server/plugins/ip.ts index d43bf8d70a..b3c8171af3 100644 --- a/backend/src/server/plugins/ip.ts +++ b/backend/src/server/plugins/ip.ts @@ -3,10 +3,10 @@ import fp from "fastify-plugin"; /*! https://github.com/pbojinov/request-ip/blob/9501cdf6e73059cc70fc6890adb086348d7cca46/src/index.js. MIT License. 2022 Petar Bojinov - petarbojinov+github@gmail.com */ const headersOrder = [ - "x-client-ip", // Most common - "x-forwarded-for", // Mostly used by proxies "cf-connecting-ip", // Cloudflare "Cf-Pseudo-IPv4", // Cloudflare + "x-client-ip", // Most common + "x-forwarded-for", // Mostly used by proxies "fastly-client-ip", "true-client-ip", // Akamai and Cloudflare "x-real-ip", // Nginx