Skip to content

Commit

Permalink
Use remote_ip instead of ip to obtain buyer IP
Browse files Browse the repository at this point in the history
remote_ip is more accurate when dealing with proxies and load balancers.
This change improves the reliability of IP detection in our application.
  • Loading branch information
aminzam committed Jan 7, 2025
1 parent 04793ad commit 5079917
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/usage/graphql_storefront.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit 5079917

Please sign in to comment.