Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[infra] Forward client ip

Neeraj Gupta419107752c32
diff --git a/infra/workers/cast-albums/src/index.ts b/infra/workers/cast-albums/src/index.ts
index 9759f22bc1..dec71fac47 100644
--- a/infra/workers/cast-albums/src/index.ts
+++ b/infra/workers/cast-albums/src/index.ts
@@ -65,6 +65,8 @@ const handleGET = async (request: Request) => {
"X-Client-Package": request.headers.get("X-Client-Package") ?? "",
"X-Client-Version": request.headers.get("X-Client-Version") ?? "",
"User-Agent": request.headers.get("User-Agent") ?? "",
+ "X-Forwarded-For": request.headers.get("CF-Connecting-IP") ?? "",
+ "CF-IPCountry": request.headers.get("CF-IPCountry") ?? "",
};
let response = await fetch(
diff --git a/infra/workers/files/src/index.ts b/infra/workers/files/src/index.ts
index a6645ddb29..8641c73fc4 100644
--- a/infra/workers/files/src/index.ts
+++ b/infra/workers/files/src/index.ts
@@ -77,6 +77,8 @@ const handleGET = async (request: Request) => {
"X-Client-Version": request.headers.get("X-Client-Version") ?? "",
"User-Agent": request.headers.get("User-Agent") ?? "",
"Range": request.headers.get("Range") ?? "",
+ "X-Forwarded-For": request.headers.get("CF-Connecting-IP") ?? "",
+ "CF-IPCountry": request.headers.get("CF-IPCountry") ?? "",
};
let response = await fetch(
diff --git a/infra/workers/public-albums/src/index.ts b/infra/workers/public-albums/src/index.ts
index 05a0fe2bb6..ef036f513b 100644
--- a/infra/workers/public-albums/src/index.ts
+++ b/infra/workers/public-albums/src/index.ts
@@ -74,6 +74,8 @@ const handleGET = async (request: Request) => {
"X-Client-Package": request.headers.get("X-Client-Package") ?? "",
"X-Client-Version": request.headers.get("X-Client-Version") ?? "",
"User-Agent": request.headers.get("User-Agent") ?? "",
+ "X-Forwarded-For": request.headers.get("CF-Connecting-IP") ?? "",
+ "CF-IPCountry": request.headers.get("CF-IPCountry") ?? "",
};
let response = await fetch(
diff --git a/infra/workers/thumbnails/src/index.ts b/infra/workers/thumbnails/src/index.ts
index bfdd981204..1672680ac6 100644
--- a/infra/workers/thumbnails/src/index.ts
+++ b/infra/workers/thumbnails/src/index.ts
@@ -69,6 +69,8 @@ const handleGET = async (request: Request) => {
"X-Client-Package": request.headers.get("X-Client-Package") ?? "",
"X-Client-Version": request.headers.get("X-Client-Version") ?? "",
"User-Agent": request.headers.get("User-Agent") ?? "",
+ "X-Forwarded-For": request.headers.get("CF-Connecting-IP") ?? "",
+ "CF-IPCountry": request.headers.get("CF-IPCountry") ?? "",
};
let response = await fetch(