From fc34c2bdcf498cd994ad13a5f20ed167466da58c Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 4 May 2024 08:51:15 +0000 Subject: [PATCH] Pass User-Agent header when calling nominatim --- matcher/nominatim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matcher/nominatim.py b/matcher/nominatim.py index c15b8fc..f065625 100644 --- a/matcher/nominatim.py +++ b/matcher/nominatim.py @@ -6,7 +6,7 @@ from collections import OrderedDict import requests -from . import CallParams +from . import CallParams, user_agent_headers Hit = dict[str, typing.Any] @@ -28,7 +28,7 @@ def lookup_with_params(**kwargs: str) -> list[Hit]: "polygon_text": 0, } params.update(kwargs) - r = requests.get(url, params=params) + r = requests.get(url, params=params, headers=user_agent_headers()) if r.status_code == 500: raise SearchError