Pass through of original IP in snippet (or workers)

For Workers & Pages, what is the name of the domain?

What is the error number?

none

What is the error message?

none

What is the issue or error you’re encountering

We use Shopify O2O and filter a request in order to translate it with Weglot - the original IP gets lost

What steps have you taken to resolve the issue?

How can we make sure to pass through the original headers in the snippet or worker?

What are the steps to reproduce the issue?

export default {
async fetch(request, env, ctx) {
if (request.headers.has(“weglot-language”)) {
return fetch(request);
}
return fetch(https://render.weglot.io/${request.url},
request);
},
};

Hi,

Thank you for contacting Clooudflare support. When proxied to Cloudflare it’s normal not to see the requests with the original IPs. Maybe you should consider enabling True-Client-IP which is only available for Enterprise plans: https://developers.cloudflare.com/fundamentals/reference/http-headers/#true-client-ip-enterprise-plan-only

Have you tried preserving the original IP by using the X-Forwarded-For header Cloudflare HTTP headers · Cloudflare Fundamentals docs or contacted Weglot to see if they have a solution for this?

We look forward to your response.