From 0d4596b85a9009e5595f80386c681fd1d839bc6b Mon Sep 17 00:00:00 2001 From: Dmitry Kobelev <43450651+vertigo-red@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:27:24 +0300 Subject: [PATCH] Update osm.py / Function fix for nominatim request headers error https://github.com/TomSchimansky/TkinterMapView/issues/129#issuecomment-2109120668 --- geocoder/osm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/geocoder/osm.py b/geocoder/osm.py index ddb750c7..65c60e04 100644 --- a/geocoder/osm.py +++ b/geocoder/osm.py @@ -321,6 +321,12 @@ class OsmQuery(MultipleResultsQuery): _RESULT_CLASS = OsmResult _KEY_MANDATORY = False + def _build_headers(self, provider_key, **kwargs): # Fix function for nominatim request headers error + """Will be overridden according to the targetted web service""" + + return {"User-Agent": 'My User Agent 1.0'} + + def _build_params(self, location, provider_key, **kwargs): # backward compatitibility for 'limit' (now maxRows) if 'limit' in kwargs: