From 50799179d3d3f1d235bbdd739c498d889ae4a7a2 Mon Sep 17 00:00:00 2001 From: Amin Zamiri Date: Tue, 7 Jan 2025 09:14:11 -0700 Subject: [PATCH] Use remote_ip instead of ip to obtain buyer IP remote_ip is more accurate when dealing with proxies and load balancers. This change improves the reliability of IP detection in our application. --- docs/usage/graphql_storefront.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/graphql_storefront.md b/docs/usage/graphql_storefront.md index b62e3cb6..f68586ab 100644 --- a/docs/usage/graphql_storefront.md +++ b/docs/usage/graphql_storefront.md @@ -39,7 +39,7 @@ QUERY # You may not need the "Shopify-Storefront-Buyer-IP" header, see its documentation: # https://shopify.dev/docs/api/usage/authentication#making-server-side-requests -response = client.query(query: query, headers: { "Shopify-Storefront-Buyer-IP": request.ip }) +response = client.query(query: query, headers: { "Shopify-Storefront-Buyer-IP": request.remote_ip }) # do something with the returned data ```