Skip to content

Commit 5079917

Browse files
committed
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.
1 parent 04793ad commit 5079917

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/usage/graphql_storefront.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ QUERY
3939

4040
# You may not need the "Shopify-Storefront-Buyer-IP" header, see its documentation:
4141
# https://shopify.dev/docs/api/usage/authentication#making-server-side-requests
42-
response = client.query(query: query, headers: { "Shopify-Storefront-Buyer-IP": request.ip })
42+
response = client.query(query: query, headers: { "Shopify-Storefront-Buyer-IP": request.remote_ip })
4343
# do something with the returned data
4444
```
4545

0 commit comments

Comments
 (0)