Update API endpoint for GeoIP web services

MaxMind is beginning to enforce policies around its API endpoints. Endpoints should use the correct hostname for the product or service, and should always use HTTPS.

[Release Note.](https://dev.maxmind.com/geoip/release-notes/2023#api-policies---temporary-enforcement-on-october-17-2023)
This commit is contained in:
Christopher Luna 2023-08-28 12:32:33 -04:00 committed by GitHub
parent 4ff0fea900
commit 7ff76a94a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ def get_location():
"""Return current location as latitude/longitude tuple.""" """Return current location as latitude/longitude tuple."""
logger.debug("query MaxMind for location") logger.debug("query MaxMind for location")
r = requests.get( r = requests.get(
"https://www.maxmind.com/geoip/v2.1/city/me", "https://geoip.maxmind.com/geoip/v2.1/city/me",
headers={"referer": "https://www.maxmind.com/en/locate-my-ip-address"}, headers={"referer": "https://www.maxmind.com/en/locate-my-ip-address"},
timeout=10, timeout=10,
) )