From f3deddc5d5975e6f879966cbc3e192b706f4cb3c Mon Sep 17 00:00:00 2001 From: Tim Van Campenhout <45393594+vancamti@users.noreply.github.com> Date: Wed, 29 Mar 2023 14:19:17 +0200 Subject: [PATCH] #183 testfix user agen ehader (#188) --- crabpy/gateway/capakey.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crabpy/gateway/capakey.py b/crabpy/gateway/capakey.py index 01c2235..f5e8eda 100644 --- a/crabpy/gateway/capakey.py +++ b/crabpy/gateway/capakey.py @@ -26,6 +26,8 @@ def capakey_rest_gateway_request(url, headers={}, params={}): :returns: Result of the call. """ try: + # calls to geoservices give a 403 if the user-agent is not set + headers["user-agent"] = "*" res = requests.get(url, headers=headers, params=params) res.raise_for_status() return res