Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lat,long from Cloudflare instead of calculating it manually #39

Merged
merged 4 commits into from
Jul 10, 2022

Conversation

JReinhold
Copy link
Owner

It turns out that Cloudflare actually exposes the client's latitude and longitude on a custom cf property on the incoming request, called IncomingRequestCfProperties.

This PR makes use of those coordinates and discards the manual conversion from country code to latitude and longitude.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 9, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1a57b73
Status: ✅  Deploy successful!
Preview URL: https://d909ba3c.reinhold.pages.dev
Branch Preview URL: https://experiment-request-cf.reinhold.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant