From 9e71e402699e3caf3100169a8ecf781bdee77d36 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Fri, 11 Feb 2022 10:06:27 +0100 Subject: [PATCH 1/3] fix: gateway requested with custom header requested from --- packages/gateway/src/gateway.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/gateway/src/gateway.js b/packages/gateway/src/gateway.js index a44e10819a..3377a774cb 100644 --- a/packages/gateway/src/gateway.js +++ b/packages/gateway/src/gateway.js @@ -236,6 +236,7 @@ function getHeaders(request) { 'X-Forwarded-For': `${request.headers.get( 'cf-connecting-ip' )}${existingProxies}`, + 'X-Requested-From': 'nft.storage', } } From 118422384e132dd4207dfdcfbf5f643233295f30 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Fri, 11 Feb 2022 10:01:02 +0000 Subject: [PATCH 2/3] chore: use X-Forwarded-Host --- packages/gateway/src/gateway.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gateway/src/gateway.js b/packages/gateway/src/gateway.js index 3377a774cb..13080de959 100644 --- a/packages/gateway/src/gateway.js +++ b/packages/gateway/src/gateway.js @@ -236,7 +236,7 @@ function getHeaders(request) { 'X-Forwarded-For': `${request.headers.get( 'cf-connecting-ip' )}${existingProxies}`, - 'X-Requested-From': 'nft.storage', + 'X-Forwarded-Host': 'nft.storage', } } From f5eddbf3514a5e32508b1b4067ddea0a07ebfdc8 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Fri, 11 Feb 2022 11:05:44 +0100 Subject: [PATCH 3/3] fix: use request host --- packages/gateway/src/gateway.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gateway/src/gateway.js b/packages/gateway/src/gateway.js index 13080de959..a90cea69b1 100644 --- a/packages/gateway/src/gateway.js +++ b/packages/gateway/src/gateway.js @@ -236,7 +236,7 @@ function getHeaders(request) { 'X-Forwarded-For': `${request.headers.get( 'cf-connecting-ip' )}${existingProxies}`, - 'X-Forwarded-Host': 'nft.storage', + 'X-Forwarded-Host': request.headers.get('host'), } }